Skip to content

hec7orci7o/express-template

Repository files navigation

express-template Production CI

Beta node npm

TypeScript Express.js MongoDB Mocha

Folder structure

  • app.ts: This is the main file of your project, it could be the entry point of your application and where you will set up your server.
  • test: this folder contains tests to check the correct operation of the application.
  • api/controllers: This directory contains the application's controllers, which are responsible for handling user input and updating the model and view accordingly.
  • api/middleware: This folder stores intermediate functionalities that act as middelwares for filtering certain requests.
  • api/models: This directory contains the application's data models, which are responsible for handling data and business logic.
  • api/routes: This directory contains the application's routing files, which map URLs to specific controllers and actions.

Getting Started

Run for a development environment

npm run ci
npm run dev

Run for a production environment

Command Line

Note this version requires to have port 3000 open on the router.

npm run ci
npm run build
npm run start

Docker

Build Docker image:

docker build -t express-template:latest .

Run the container:

docker run -p 3000:3000 --env-file .env express-template:latest

Learn More

To learn more about Express.js, take a look at the following resources:

You can check out the Expressjs GitHub repository