res.status(200).json({ message: "Hello world" })
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" })
})
res.status(200).json({ message: "Hello world" })
res.json({token});
res.status(500).json('Server Error');
return res.status(400).json({
errors: errors.array()
});
const express = require('express');
const app = express();
app.use(express.json());
app.post('*', (req, res) => {
req.body; // The json object sent to the server
});
const port = 3000;
app.listen(port, () => console.log(`Listening on port ${port}.`));