https://github.com/tranquangvu/expressjs-simple-starter
https://github.com/tranquangvu/expressjs-simple-starter
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tranquangvu/expressjs-simple-starter
- Owner: tranquangvu
- Created: 2021-09-26T15:23:10.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-26T15:44:54.000Z (almost 5 years ago)
- Last Synced: 2025-02-23T20:42:25.265Z (over 1 year ago)
- Language: JavaScript
- Size: 76.2 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Expressjs Simple Starter
Simple starter for building RESTful APIs using Node.js, Express
## Features
- Express
- CORS enabled
- Various HTTP headers with [helmet](https://github.com/helmetjs/helmet)
- Load environment variables from .env files with [dotenv](https://github.com/rolodato/dotenv-safe)
- Resquest logger with [morgan](https://github.com/expressjs/morgan)
- Request validation with [joi](https://github.com/hapijs/joi)
- Application logger with [wiston](https://github.com/winstonjs/winston)
- Gzip compression with [compression](https://github.com/expressjs/compression)
- Linter with [eslint](http://eslint.org)
- ES6+ & Babel
## Getting Started
#### Install dependencies:
```bash
yarn install
```
#### Environment variables:
```bash
cp .env.example .env
```
## Start development server
```bash
yarn start
```
## Start production server
Install [pm2](https://www.npmjs.com/package/pm2) then run commands:
```bash
yarn build
yarn prod
```
## Linter
```bash
yarn lint
yarn lint:fix
```