https://github.com/hrkings/express-typescript-template
An easy to get started Express API template with typescript support
https://github.com/hrkings/express-typescript-template
Last synced: 3 months ago
JSON representation
An easy to get started Express API template with typescript support
- Host: GitHub
- URL: https://github.com/hrkings/express-typescript-template
- Owner: HRKings
- Created: 2021-10-23T07:00:01.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-15T06:42:58.000Z (over 3 years ago)
- Last Synced: 2024-12-27T13:23:27.371Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 75.2 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express Typescript Template
This repository contains a feature packed Express server template, including a basic architecture and developer tools to make the DX very friendly.
# What's used
* NodeJS [version 16.10+]
* TypeScript [version 4.4.4+]
* pnpm (a very fast and disk efficient package manager) [version 6.18.0+]# What's included
API Server utilities:
* [morgan](https://www.npmjs.com/package/morgan)
* HTTP request logger middleware
* [helmet](https://www.npmjs.com/package/helmet)
* Helps you secure your Express apps by setting various HTTP headers
* [dotenv](https://www.npmjs.com/package/dotenv)
* Loads environment variables from a `.env` file into `process.env`Development utilities:
* [nodemon](https://www.npmjs.com/package/nodemon)
* Hot Reloading support during the development
* [eslint](https://www.npmjs.com/package/eslint)
* A powerful linting tool
* [mocha](https://www.npmjs.com/package/mocha)
* ☕️ Simple and flexible testing framework
* [supertest](https://www.npmjs.com/package/supertest)
* HTTP assertions for API testing## Setup
To install all the dependencies, just run:
```bash
pnpm i
```## Development
To start the server in development mode (with auto reloading when changes are detected), use the following command:
```
pnpm run dev
```## Lint
To auto fix all linting problems using ESLint, run:
```
pnpm run lint
```## Test
The template already includes tests for the provided endpoints and middleware, to run the tests you can run:
```
pnpm test
```## Compile and run
If you just want to compile your code and run (in a production environment for example), just use:
```
pnpm run build
pnpm start
```