Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huksley/my-node-rest-api-app
https://github.com/huksley/my-node-rest-api-app
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/huksley/my-node-rest-api-app
- Owner: huksley
- Created: 2020-11-07T21:22:49.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-09T09:01:47.000Z (about 4 years ago)
- Last Synced: 2024-11-06T20:29:19.992Z (2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless Framework Node REST API on AWS
This template demonstrates how to make a simple REST API with Node.js running on AWS Lambda and API Gateway using the traditional Serverless Framework.
This template does not include any kind of persistence (database). For a more advanced examples check out the [examples repo](https://github.com/serverless/examples/) which includes Typescript, Mongo, DynamoDB and other examples.
## Setup
Run this command to initialize a new project in a new working directory.
`sls init aws-node-rest-api`
## Usage
**Deploy**
This example is made to work with the Serverless Framework dashboard which includes advanced features like CI/CD, monitoring, metrics, etc.
```
$ serverless login
$ serverless deploy
```To deploy without the dashboard you will need to remove `org` and `app` fields from the `serverless.yml`, and you won’t have to run `sls login` before deploying.
**Invoke the function locally.**
```
serverless invoke local --function hello
```**Invoke the function**
```
curl https://xxxxxxxxx.execute-api.us-east-1.amazonaws.com/dev/
```