- Node 16
- Mysql 8
- Serverless
- Install the serverless CLI via NPM:
npm install -g serverless
- Install NPM packages
- Rename or copy the
.env.dev
file to .env
- Set your database credentials in your
.env
file
- Create the database and table with the following script
CREATE DATABASE IF NOT EXISTS `indra`;
USE `indra`;
CREATE TABLE `products` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(250) DEFAULT NULL,
`description` varchar(250) DEFAULT NULL,
PRIMARY KEY (`id`)
);
# development
$ npm run start
# development
$ serverless openapi generate
# development
$ npm run sls:package
# unit tests
$ npm run test
# test coverage
$ npm run test:cov