How to make get and post API in Node js – API stands for “application programming interface.” APIs allow one application to “talk-to” another to allow for the transfer of stored data or instructions. API’s are everywhere in your daily life, from the embedded YouTube videos on social media applications to the smart speaker on your kitchen counter. They make it possible for software developed at different times by different people to interact and, thereby, increase functionality and productivity.

GET API in NodeJS
const express=require('express')
const app=express()
const port=3000
//get APi as printed Welcome Home
app.get('/get',(req,res)=>{
res.send("Welcome HOME ")
})
app.listen(port,()=>{
console.log(`server running on the port ${port}`)
})
POST API in NodeJS
const express=require('express')
const app=express()
const port=3000
app.post('/post',(req,res)=>{
res.send("Welcome Home")
})
app.listen(port,()=>{
console.lo(`server running on the port ${port}`)
})
How to Install Visual Studio Code 2019 for Windows 10 || VS Code
Complete Source Code here get and post API in Node js
const express=require('express')
const app=express()
const port=3000
//get APi as printed Welcome Home
app.get('/get',(req,res)=>{
res.send("Welcome HOME ")
})
app.listen(port,()=>{
console.log(`server running on the port ${port}`)
})
// //post API as printed Welcom Home
// const express=require('express')
// const app=express()
// const port=3000
// app.post('/post',(req,res)=>{
// res.send("Welcome Home")
// })
// app.listen(port,()=>{
// console.lo(`server running on the port ${port}`)
// })
Output

I hope my interview experience will be helpful for you. Best of luck with your job interview.
Additional Reading
- SEO Practices Everyone Should Follow SEO Rules
- Complete Top SEO Checklist
- Yoast Seo Premium 15.2 Nulled – WordPress SEO Plugin
- Top 50+ SEO Interview Questions
- What is a Backlink? How to Get More Backlinks
- TCS INTERVIEW QUESTIONS – CLICKE HERE
READ MORE
If you found this post useful, don’t forget to share this with your friends, and if you have any query feel free to comment it in the comment section.
Thank you 🙂 Keep Learning !