Simple AWS Lambda REST API in Node.js with Serverless.
You can access the API at https://g5x6nvsdj3.execute-api.us-east-1.amazonaws.com.
Install Serverless:
$ npm i -g serverless
You'll also need Java and AWS CLI.
Install the dependencies:
$ npm i
Run the following command:
$ npm run init
Configure AWS credentials by running the following command:
$ aws configure
You can put any value for the access key ID and the secret access key. All that matters is the region name that must be "local":
AWS Access Key ID [None]: dev
AWS Secret Access Key [None]: dev
Default region name [None]: local
Default output format [None]:
When asked about the default output format, you can type "json" or just press enter.
$ npm run dev
The API is now accessible at localhost:3000.
To deploy this entire service via Serverless you must follow the following steps.
First, login with Serverless:
$ sls login
Then add the following two properties at the top of the serverless.yml
file:
org: <name of your org>
app: omninext
Lastly, run:
$ npm run deploy
Now you should be able to access the API through a URL similar to https://g5x6nvsdj3.execute-api.us-east-1.amazonaws.com.
$ npm run docs
The documentation is now accessible at localhost:4000.
Omninext is licensed under the terms of the Creative Commons Zero v1.0 Universal license.
For more information, see the Creative Commons website.