Skip to content

Instantly share code, notes, and snippets.

@numanayhan
Created June 17, 2020 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save numanayhan/7a5f2b1dcb8f6bb0f62511e70d0d86b1 to your computer and use it in GitHub Desktop.
Save numanayhan/7a5f2b1dcb8f6bb0f62511e70d0d86b1 to your computer and use it in GitHub Desktop.
nodejs-api
const express = require('express');
const app = express();
app.get('/',function(req,res){
res.status(200).send(JSON.stringify({
result:"200",
message:"api get çalıştı"
}))
})
app.post('/',function(req,res){
res.status(200).send(JSON.stringify({
result:"200",
message:"api post çalıştı"
}))
})
app.listen(process.env.PORT || 3000 ,()=>{
console.log("app çalıştı");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment