Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
require('dotenv').config()
const express = require('express')
const app = express()
const mongoose = require('mongoose')
var cors = require('cors')
mongoose.connect(process.env.DATABASE_URL,{UseNewUrlParser:true})
const db = mongoose.connection
db.on('error', (error) => console.error(error))
db.once('open',() => console.log('Connected to database'))
app.use(cors([ allowedHeaders: ["sessionId", "Content-Type"],
exposedHeaders: ["sessionId"],
origin: "*",
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
preflightContinue: false,])) // Use this after the variable declaration
//cookie-parser
app.use(cookieParser())
//express json library
app.use(express.json())
app.use(express.json())
const authenticationRouter = require('./routes/authentication')
app.use('/signup', authenticationRouter)
const loginRouter = require('./routes/login')
app.use('/login', loginRouter)
//mahesh committed for club and admin
app.use("/v1/club", clubRoute);
app.use("/v1/event", eventRoute);
app.listen(3002, ()=> console.log('Server Started'))