Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions backend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@ const app = express()
// const passport = require("passport")
// const magicLogin = require("passport-magic-login")
const path = require("path")
const cors = require('cors')
require("dotenv/config")



const corsOptions = {
origin:'http://localhost:3000',
methods:['GET', 'PUT', 'POST', 'PATCH','DELETE'],
optionsSuccessStatus:200,
allowedHeaders:['Content-Type', 'Authorization'],
credentials:true
}

// Import models
// Notes: remove model imports won't add schemas to cs_club database on Linux
// Will remove model imports once importing routes
Expand All @@ -13,6 +24,7 @@ require("./models/projects/projects-model")
require("./models/organizations/orgs-model")

// Parsing
app.use(cors(corsOptions))
app.use(express.urlencoded({ extended: true }))
app.use(express.json())
app.use(express.static(path.join(path.resolve("./"), "public")))
Expand Down
Loading