Skip to content

zahreva/express-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dependency Status devDependencies Status

Lightweight Express.js starter


To start application run npm run start:dev

Features:

  • Routes are being generated automatically from folder src/routes.
  • Custom error handler with error codes, statuses and messages (src/utils/error-hanlder).
  • Request validator middleware.
  • Alias configuration. Example: require('#utils') instead of require('../../../../utils'). Configuration is located in package.json/_moduleAliases.
  • Husky pre-commit linting stage.
  • Git-cz + cz-emoji configuration. Simply run npm run commit to commit all unstaged files.

App structure:

src
├── config
│   └── ...
├── middlewares
│   └── ...
├── routes
│   └── v1 // API Version
│       ├── bots
│       │   ├── get.js // HTTP GET controller => GET ../v1/bots
│       │   ├── post.js // HTTP POST controller => POST ../v1/bots
│       │   ├── router.js // Current route endpoint declaration
│       │   ├── schemas.js // Validation schemas
│       │   └── {{id}} // Analogue of Express.js path parameters declaration  ../v1/bots/:id
│       │       ├── get.js // Example: GET ../v1/bots/1337
│       │       └── router.js
└── utils
    └── ...

About

Express.js with custom error handling, dynamic route generation, pre-commit hooks, Prettier + ESlint, alias and more!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors