sbuhacks/api/index.js

22 lines
569 B
JavaScript
Raw Normal View History

2022-09-24 17:06:11 -04:00
#!/usr/bin/env node
const express = require('express')
const PORT = 4000
const app = express()
const cookieParser = require('cookie-parser')
const bodyParser = require('body-parser');
app.use(express.urlencoded({ extended: true }))
// app.use(cors({
// origin: ["http://127.0.0.1:3000", "http://localhost:3000", "*"],
// credentials: true
// }))
app.use(express.json())
app.use(cookieParser())
app.use(bodyParser.json())
const router = require('./routes/router')
app.use('/api', router)
2022-09-24 17:53:54 -04:00
app.listen(PORT, () => console.log(`Server running on port ${PORT}`))