To builde and run the project, you will need a few thing:
git clone --depth=1 https://github.com/updata7/node-mysql-koa2.git
cd node-mysql-koa2
npm install
npm run build
npm run dev
test
npm run test
Generate test coverage report
npm run cover
Navigate to http://localhost:9091/api/docs
, you would see and test the API!!!
Note! Make sure you have already built the proejct and using
npm run dev
Name | Description |
---|---|
src/config | Contains config environment to be used by the config package, such as MongoDB URI, jwtSecret, and etc. |
dist | Contains the distributable (or output) from your TypeScript build |
node_modules | Contains all your npm dependencies |
src | Contains your source code that will be compiled to the dist dir |
src/middlewares | Contains the middlewares to intercept requests |
src/models | Model define Mysql schemas that will be used in storing and retrieving data from Mysql |
src/engines | This module will directly operate the database through the model |
src/handlers | This field will be used in router and call the engines |
src/routers | The router for client call |
src/swaggers | Swagger UI for API |
src/utils | Some common internal interfaces |
src/bin/server.ts | Entry point to your Koa project |
src/app.ts | The helper file be used by server.ts |
package.json | File that contains npm dependencies as well as build scripts |
tsconfig.json | Config settings for compiling server code written in TypeScript |
MIT
If it is helpful to you, please click a star to encourage me, or if you have better suggestions and opinions,
please come forward and let me know and leave a message. I hope it can help you learn!
Thanks!Let's encourage each other!