Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/belongco/nextjs-serverless-setup
Deploying a next JS site to serverless
https://github.com/belongco/nextjs-serverless-setup
nextjs react serverless
Last synced: 3 months ago
JSON representation
Deploying a next JS site to serverless
- Host: GitHub
- URL: https://github.com/belongco/nextjs-serverless-setup
- Owner: belongco
- License: mit
- Created: 2018-07-02T12:12:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-26T05:05:36.000Z (about 6 years ago)
- Last Synced: 2024-06-17T14:34:19.692Z (5 months ago)
- Topics: nextjs, react, serverless
- Language: JavaScript
- Size: 419 KB
- Stars: 51
- Watchers: 6
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nextjs-serverless
Deploying a next JS site to serverless.### Running it locally
First install the dependencies
```
yarn install
```You will also need to install [DynamoDB locally](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.DownloadingAndRunning.html).
To start DynamoDB run,
```
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
```
For Development,
```
yarn run dev
```### Deploying it on Lambda
Ensure you populate the serverless-vpc-variables.yml file with
the values from your infrastucture against the various variables
defined.Creating a domain.
```
serverless create_domain --stage staging
```
It might take about 40 minutes for the domain to initialize.Post that, deploy the serverless stack using the command
```
SLS_DEBUG=* serverless deploy --stage staging # For staging
SLS_DEBUG=* serverless deploy --stage production # For production
```