To build and run this app locally you will need a few things:
- Install Node.js
- Install Serverless CLI
npm install -g serverless
- Install VS Code
- Clone the repository
- Install dependencies
cd <project_name>
npm i
- Create .env file in the root directory and fill in the credentials:
DB_HOST=""
DB_USERNAME=""
DB_PASSWORD=""
DB_NAME=""
PRIVATE_KEY=""
PUBLIC_KEY=""
- Create some code in the app.tsfile, create some controllers etc.
- Start the Service (this sets the local port to 3000)
npm run dev
- To change the port run
serverless offline start -s DEV --reloadHandler --httpPort <port>
Finally, send requests to http://localhost:<port>
In the .vscode folder is a launch.json. Select Debug Serverless offline and set breakpoints.
The Debugger will run npm run debug.
If your OS is Windows Vscode will detect it and will run npm run debug:win