npm i
Before running anything locally, create a .env
file and initialize your env variable like so:
DB=mongodb://localhost:27017/boilerplate
SECRET_KEY=NSA
REACT_APP_URL=http://localhost:3000 // when cors is enabled, this will be the only origin to send requests
PS: if you're deploying to a VPS/VPC u should have another .env.production
file and add some logic to handle that on the ./config/config.js
file.
Start the db locally
npm run database
PS: replace mongo-data
with the name of the folder your data is stored.
start dev server
npm run dev
start prod server
npm start
User
Profile
Post
User
POST /api/user/register
// Register a new user and returns user data with the generated token
// Public
POST /api/user/login
// Login user and returns user data with the generated token
// Public
GET /api/user/verify
// Verifies token and returns current user data
// Private
DELETE /api/user/logout
// Logout
// Private
Profile
GET /api/profile
// GET current user profile
// Private
POST /api/profile
// create or Edit user profile
// Private
DELETE /api/profile
// Delete user and profile
// Private
GET /api/profile/all // Not available yet
// Get all profiles
GET /api/profile/handle/:handle // Not available yet
// Get profile by handle
Post
POST /api/post
// Create a new post
// Private
GET /api/post/all
// Get all the posts
GET /api/post/:id
// Get Post by ID
// Private
DELETE /api/post/:id
// Delete Post by ID
// Private
PATCH /api/post/:id
// Update a post
// Private
本文翻译自下面的链接。 https://medium.freecodecamp.org/rest-is-the-new-soap-97ff6c09896d REST is the new SOAP REST是新的SOAP(Simple Object Access Protocol) Written by Pascal Chambon, reviewed by Rapha?l Gomès 作者Pas
soap rest Written by Pascal Chambon, reviewed by Raphaël Gomès 由Pascal Chambon撰写,由RaphaëlGomès评论 Update: this article mostly deals with the RESTish ecosystem, which now constitutes a major part of web
express-rest-api-boilerplate Express REST API with JWT Authentication and support for sqlite, mysql, and postgresql authentication via JWT routes mapping via express-routes-mapper support for sqlite,
Koa REST API Boilerplate Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov, and Circle CI Koa REST API Boilerplate is a highly opinionated boilerplate template fo
express-mongodb-rest-api-boilerplate Also express-graphql-mongodb-boilerplate - GraphQL API Boilerplate Authentication from scratch Sign In, Sign Up, Reset Password, Change Password, Update User E-mai
RESTful API using Node.js, Express, Mongoose & TypeScript This is a boilerplate for building scalable and robust REST APIs using Node.js & TypeScript. Table of Contents Prerequisites Features Getting
Express ES2017 REST API Boilerplate Boilerplate/Generator/Starter Project for building RESTful APIs and microservices using Node.js, Express and MongoDB Features No transpilers, just vanilla javascrip
A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular. �� Description This boilerplate is made to quickly prototype backend applicat