This is a demo app when I was learning Node.js with pure ESM support, test coverage, ci/cd, container support and swagger integration.
pnpm startThis will listen the tcp port 8080 to provide the http service.
pnpm testUsing mocha, chai to do the E2E testing. (Assertion library and test framework)
Using c8 to do the code coverage. Try pnpm run test:coverage to see the coverage report under the coverage directory.
TIPS: Using mocha -g ${keyword} to execute the test cases with name contains ${keyword}.
or pnpm run test:grep ${keyword}.
Touch a file called .env to export env variables on local dev machine (by dotenv).
This project using swagger-ui to provide the swagger UI and using swagger-autogen to generate the swagger spec json file. The default swagger ui page is /api/docs.
The default directory for these functions is ./api.
I'm not using the way Vercel recommends, but the traditional way based on express - which makes it easier for me to deploy by any means, like using Docker or directly using node.js.
MIT