Get started developing...
You need to create a .env file and configure your database at first, then set up the database and start developing / testing.
# install deps
yarn install
# run in development mode
yarn dev
# run tests
yarn test
# check code styles
yarn lint
# check type errors
yarn typecheckInstall all package dependencies (one time operation)
yarn installRuns the application is development mode. Should not be used in production
yarn devor debug it
yarn dev:debugCompiles the application and starts it in production mode
yarn compile
yarn startRun the Mocha unit tests
yarn testor debug them
yarn test:debugRun the tests and output a JUnit-style XML test results file at ./test/test-results.xml
yarn test:junitMake sure the database is running
- Open you're browser to http://localhost:3000
- Invoke the
/examplesendpointcurl http://localhost:3000/api/v1/examples
yarn dev:debug
yarn test:debug
Use the configurations in .vscode/launch.json file
Check types and fix all linter errors
Check code styles
yarn lint
yarn lint:fix # fix linter errors as wellCheck type error
yarn typecheck
This template project was originally generated by cdimascio/generator-express-no-stress-typescript, and added with mongoose and several DevOps tools (Dependabot and GitHub Actions).
- Typescript - Typescript is a typed superset of JavaScript that compiles to plain JavaScript
- Express.js - Fast, unopinionated, minimalist web framework for Node.js
- Mongoose - Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment.
- Pino - Extremely fast node.js logger, inspired by Bunyan. It also includes a shell utility to pretty-print its log files
- dotenv - Loads environment variables from .env for nodejs projects
- Swagger - is a simple yet powerful representation of your RESTful API.
- SwaggerUI - dynamically generate beautiful documentation and sandbox from a Swagger-compliant API
- express-openapi-validator - An OpenApi validator for ExpressJS that automatically validates API requests using an OpenAPI 3.x specification
More information here