Created
January 26, 2021 03:00
-
-
Save treddson/3aff0de8fd12c6806731be9c75f4da25 to your computer and use it in GitHub Desktop.
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(); | |
const cors = require('cors'); | |
const pool = require('./db'); | |
//middleware | |
app.use(cors()); | |
app.use(express.json()) | |
//routes | |
app.post("/todos", async (req, res) => { | |
try { | |
console.log(req.body); | |
} catch (error) { | |
console.log(error.message); | |
} | |
}); | |
app.listen(3050, () => { | |
console.log(`Listening on port 3050`); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment