This is boilerplate for typescript & express and dependcy injection
- Custom Error support. You can create any custom error with message,code,httpCode like throw new CustomError()
- Dependcy Injection for all modules
Node, Express, Typescript, tsyringe
GET /error| Parameter | Type | Description |
|---|---|---|
- |
- |
You will see uncustom error handler {"message":"Internal server error","success":false} |
GET /custom-error| Parameter | Type | Description |
|---|---|---|
- |
- |
You will see custom error handler {"message":"Example Error For Test","errorCode":1,"success":false} |
GET /foos| Parameter | Type | Description |
|---|---|---|
- |
- |
You will see custom error handler {"message":"Example Error For Test","errorCode":1,"success":false} |
Clone the project
git clone https://github.com/erdemkosk/typescript-express-boilerplate.gitGo to the project directory
cd typescript-express-boilerplateInstall dependencies
npm installStart the server
npm run devCreate a Docker image
docker build -t typescript-express-boilerplate . Run a Docker image
docker run -p 8080:8080 typescript-express-boilerplate Contributions are always welcome!
