Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

express return json

const express = require("express")
const port = process.env.PORT || 5000;

const app = express();

app.listen(port, () => console.log("Server startet at port ", port));

app.get("/api/goals", (req, res) => {
    res.status(200).json({ message: "Get goals" })
})
 
PREVIOUS NEXT
Tagged: #express #return #json
ADD COMMENT
Topic
Name
4+8 =