forked from RochMoreau/secure-web-dev-workshop3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (18 loc) · 706 Bytes
/
Copy pathindex.js
File metadata and controls
24 lines (18 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const express = require('express')
const locationController = require('./locations/locations.controller')
const usersController = require('./users/users.controller')
const mongoose = require('mongoose')
require('dotenv').config()
const localStrategy = require("./authentication/local.strategy")
const app = express()
const port = 3000
app.use(locationController)
app.use(usersController)
async function main(){
const client = await mongoose.connect(process.env.MONGO_URI).then(()=>{console.log("Connected")});
app.listen(port, () => {
console.log(`API listening on port ${port}, visit http://localhost:${port}/`)
})
}
main()
app.get('', (req,res) => { res.send("Hello World")})