https://github.com/antogno/omninext
Simple AWS Lambda REST API in Node.js with Serverless.
https://github.com/antogno/omninext
api aws aws-lambda node serverless serverless-framework
Last synced: about 2 months ago
JSON representation
Simple AWS Lambda REST API in Node.js with Serverless.
- Host: GitHub
- URL: https://github.com/antogno/omninext
- Owner: antogno
- License: cc0-1.0
- Created: 2024-02-21T19:01:16.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-02T10:55:27.000Z (over 2 years ago)
- Last Synced: 2025-03-12T02:55:04.405Z (over 1 year ago)
- Topics: api, aws, aws-lambda, node, serverless, serverless-framework
- Language: TypeScript
- Homepage:
- Size: 134 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> [!NOTE]
> This project was created as a technical test on behalf of [Omninext](https://omninext.it).
# Omninext
Simple AWS Lambda REST API in Node.js with Serverless.
---
## Table of contents
- [Usage](#usage)
- [Deploy](#deploy)
- [Docs](#docs)
- [License](#license)
## Usage
You can access the API at [https://g5x6nvsdj3.execute-api.us-east-1.amazonaws.com](https://g5x6nvsdj3.execute-api.us-east-1.amazonaws.com).
### Pre-requisites
Install [Serverless](https://www.serverless.com):
```console
$ npm i -g serverless
```
You'll also need Java and [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
### Setup
Install the dependencies:
```console
$ npm i
```
Run the following command:
```console
$ npm run init
```
Configure AWS credentials by running the following command:
```console
$ 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":
```console
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.
### Run
```
$ npm run dev
```
The API is now accessible at [localhost:3000](http://localhost:3000).
## Deploy
To deploy this entire service via Serverless you must follow the following steps.
First, login with Serverless:
```console
$ sls login
```
Then add the following two properties at the top of the `serverless.yml` file:
```yml
org:
app: omninext
```
Lastly, run:
```console
$ 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](https://g5x6nvsdj3.execute-api.us-east-1.amazonaws.com).
## Docs
```console
$ npm run docs
```
The documentation is now accessible at [localhost:4000](http://localhost:4000).
## License
Omninext is licensed under the terms of the [Creative Commons Zero v1.0 Universal license](https://github.com/antogno/omninext/blob/master/LICENSE).
For more information, see the [Creative Commons website](https://creativecommons.org/publicdomain/zero/1.0).