Skip to content

Instantly share code, notes, and snippets.

@treddson
Created January 26, 2021 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treddson/3aff0de8fd12c6806731be9c75f4da25 to your computer and use it in GitHub Desktop.
Save treddson/3aff0de8fd12c6806731be9c75f4da25 to your computer and use it in GitHub Desktop.
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