Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Nodebestpractices | 87,387 | 5 days ago | 36 | cc-by-sa-4.0 | JavaScript | |||||
:white_check_mark: The Node.js best practices list (March 2023) | ||||||||||
Express | 60,372 | 1,122,978 | 79,504 | 4 days ago | 299 | April 29, 2022 | 155 | mit | JavaScript | |
Fast, unopinionated, minimalist web framework for node. | ||||||||||
Fiber | 25,361 | 656 | 11 hours ago | 275 | September 08, 2022 | 39 | mit | Go | ||
⚡️ Express inspired web framework written in Go | ||||||||||
Passport | 21,295 | 81,272 | 3,916 | 5 days ago | 32 | May 20, 2022 | 363 | mit | JavaScript | |
Simple, unobtrusive authentication for Node.js. | ||||||||||
Javascript Testing Best Practices | 21,034 | 13 days ago | 55 | mit | JavaScript | |||||
📗🌐 🚢 Comprehensive and exhaustive JavaScript & Node.js testing best practices (December 2022) | ||||||||||
N Blog | 14,445 | 3 years ago | 17 | JavaScript | ||||||
《一起学 Node.js》 | ||||||||||
Apollo Server | 13,278 | 5,326 | 1,153 | 2 days ago | 305 | August 26, 2022 | 40 | mit | TypeScript | |
🌍 Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more. | ||||||||||
Mean | 12,176 | 3 months ago | February 02, 2017 | 49 | TypeScript | |||||
The MEAN stack uses Mongo, Express, Angular(6) and Node for simple and scalable fullstack js applications | ||||||||||
Postgraphile | 11,860 | 76 | 99 | a month ago | 156 | May 25, 2022 | 63 | mit | TypeScript | |
Execute one command (or mount one Node.js middleware) and get an instant high-performance GraphQL API for your PostgreSQL database! | ||||||||||
Node Elm | 11,215 | a year ago | 62 | gpl-2.0 | JavaScript | |||||
基于 node.js + Mongodb 构建的后台系统 |
This is a simple REST API developed using node and express with typescript
If you found this project useful, then please consider giving it a on Github and sharing it with your friends via social media.
You need to install PostgreSQL
For Windows
C:\Program Files\PostgreSQL\10\bin
,
C:\Program Files\PostgreSQL\10\lib
For Ubuntu
Installation
sudo apt update
sudo apt-get install postgresql postgresql-contrib
Manage PostgreSQL
service
sudo systemctl {status | start | restart | stop} postgresql
rename .env-sample
to .env
in the file the DB connection string need to be updated according to your credentials
.
ex : postgres://<YourUserName>:<YourPassword>@localhost:5432/<YourDatabase>
you can find the DB and other details under src/db
create a database with the name node-typescript-rest-api
and then run/ import the .sql
files (extract the sql files from sql.zip).
Or you can run npm run seed
.
install pm2
globally with npm install -g pm2
git clone https://github.com/nmanikiran/rest-api-node-typescript.git
npm install
npm start
- This will start the application and run on port 3000
npm run dev
- This will start the application in development mode
npm run watch & pm2 start ecosystem.config.js
to start the application with cluster for scalability
you can change port in .env
file check .env-sample
src
index.ts # Application entry point
routes # Application routes / endpoints
controllers # Express route controllers for all the endpoints of the app
repositories # All the database interaction logic is here
db # DB related files like connection / seed data
handlers # Common logic
logs # application logs
middlewares # express middlewares
models # DB Models (Postgress)
validators # API Request object validations
The application exposes a few REST endpoints
HTTP
GET
/api/lessons
HTTP
GET
/api/lessons/:id
HTTP
GET
/api/courses
You can use the following code snippet to call the secured endpoint:
fetch("http://localhost:3000/api/courses", {
method: "GET",
headers: {
"Content-Type": "application/json",
},
})
.then((response) => {
if (response.status === 200) {
response.json().then((j) => console.log(j));
} else {
console.log("ERROR", response.status);
}
})
.catch((error) => console.log(error));
Mani Kiran N |
Tushar Gupta |
Feel free to reach out to me through @nmanikiran if you have any questions or feedback!