Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/api/posts', function(req, res) {
- fs.readFile('./json/posts.json', function(err,data){
- if (!err){
- console.log(data)
- res.send(JSON.parse(data))
- }
- else{
- console.log(err)
- }
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement