Skip to content

ntxinh/expressjs-starter-kit

Repository files navigation

JavaScript Style Guide

JavaScript Style Guide

STACK


HOW TO RUN

  • Copy variables.env.sample to variables.env & custom it
npm start

// or

npm run watch
  • Data sample:
npm run seed

npm run seed:delete

npm run seed:refresh
  • Lint:
npm run lint

ROUTES / API

  • Root url:
curl -X GET \
  http://localhost:3000/
  • API Authenticate:
curl -X POST \
  http://localhost:3000/api/authenticate \
  -H 'content-type: application/json' \
  -d '{
	"email": "xinh@mail.com",
	"password": "123456"
}'
  • API Get users:
curl -X GET \
  http://localhost:3000/api/users \
  -H 'authorization: Bearer {{YOUR_TOKEN}}'
  • API Sign up:
curl -X POST \
  http://localhost:3000/api/sign-up \
  -H 'content-type: application/json' \
  -d '{
	"name": "Mail1",
	"email": "mail1@mail.com",
	"password": "123456"
}'
  • API Confirm sign up:
curl -X GET \
  'http://localhost:3000/api/confirm-sign-up?token={{YOUR_TOKEN}}'
  • API Test axios:
curl -X GET \
  http://localhost:3000/api/test-axios \
  -H 'authorization: Bearer {{YOUR_TOKEN}}'
  • API Forgot password:
curl -X POST \
  http://localhost:3000/api/forgot-password \
  -H 'content-type: application/json' \
  -d '{
	"email": "xinh@mail.com"
}'
  • API Confirm reset password:
curl -X GET \
  'http://localhost:3000/api/confirm-resest-password?token={{YOUR_TOKEN}}'
  • API Get user current:
curl -X GET \
  http://localhost:3000/api/get-user-current \
  -H 'authorization: Bearer {{YOUR_TOKEN}}'

REFERENCES