-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Test Build CI | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
pull_request: | ||
branches: ['master'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build --if-present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,46 @@ | ||
[![tests](https://github.com/nc-minh/nodejs-express-boilerplate/actions/workflows/test.yml/badge.svg)](https://github.com/nc-minh/nodejs-express-boilerplate/actions/workflows/test.yml) | ||
|
||
# NodeJs Express boilerplate | ||
|
||
Here's a boilerplate project for rapidly constructing a web server using Node.js, Express, Mongoose, and TypeScript. It includes file upload functionality using multer. Additionally, it integrates several syntax validation tools such as commitlint, eslint, lint-staged, prettier, and husky. | ||
|
||
# Quick start | ||
|
||
Prepare: | ||
|
||
```json | ||
"engines": { | ||
"node": "20.x", | ||
"npm": "10.x" | ||
} | ||
``` | ||
|
||
Clone the repo: | ||
|
||
``` | ||
git clone git@github.com:nc-minh/nodejs-express-boilerplate.git | ||
``` | ||
|
||
Install the dependencies: | ||
|
||
``` | ||
npm i | ||
``` | ||
|
||
Set the environment variables: | ||
|
||
``` | ||
cp .env.example .env | ||
``` | ||
|
||
Start on dev: | ||
|
||
``` | ||
npm run dev | ||
``` | ||
|
||
Start on prod: | ||
|
||
``` | ||
npm run build && npm run start | ||
``` |