Created
June 17, 2020 07:45
-
-
Save numanayhan/7a5f2b1dcb8f6bb0f62511e70d0d86b1 to your computer and use it in GitHub Desktop.
nodejs-api
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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