Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khanhtc1202/node-server-boilerplate
Seed NodeJS api server
https://github.com/khanhtc1202/node-server-boilerplate
api-server rest-api seed
Last synced: 24 days ago
JSON representation
Seed NodeJS api server
- Host: GitHub
- URL: https://github.com/khanhtc1202/node-server-boilerplate
- Owner: khanhtc1202
- Created: 2018-01-19T17:06:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T01:45:48.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T22:29:42.986Z (about 1 month ago)
- Topics: api-server, rest-api, seed
- Language: JavaScript
- Homepage:
- Size: 109 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node Api Server ( Seed )
[![CodeFactor](https://www.codefactor.io/repository/github/khanhtc1202/node-api-seed/badge)](https://www.codefactor.io/repository/github/khanhtc1202/node-api-seed)
An simple nodejs api server.
## Project structure
```bash
.
├── app.js
├── router.js
├── controllers
│ └── index.js
│ └── system.js
├── infras
│ └── index.js
│ └── mysql-client.js
├── libs
│ └── index.js
│ └── middleware.js
├── models
│ └── index.js
│ └── sql_model.js
├── utils
│ └── index.js
│ └── errors.js
└── package.json
```## Usage
### For running
Install dependence packages by command
```bash
$ npm install
```Install `nodemon` (optional) on golbal scope in your host machine (flag `-g`) using `npm`
Start api server
```bash
$ npm start
```or
```bash
$ npm run dev
```(if you don't have `nodemon` start server by `node app.js`)
### Note
Starter kit has `ping` endpoint which test the availability of connection between this node js server and the sql database defined under `$DATABASE_SQL_URL` env var in your shell.
Please run up a mysql server to make this check pass.You can startup a mysql server with docker by using docker-compose manifest included in this boilerplate.
```bash
$ docker-compose up -d --build
```Done! :)))