-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
21 lines (19 loc) · 656 Bytes
/
app.js
File metadata and controls
21 lines (19 loc) · 656 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import express from 'express'
import HelloController
from "./controllers/hello-controller.js"
import UserController
from "./controllers/users/users-controller.js"
import TuitsController
from "./controllers/tuits/tuits-controller.js";
import cors from 'cors'
import mongoose from "mongoose";
const CONNECTION_STRING = 'mongodb+srv://goswamyrishi:3PgTZrEYo8UZ7MXJ@cluster0.mbih633.mongodb.net/tuiter'
|| 'mongodb://localhost:27017/tuiter';
mongoose.connect(CONNECTION_STRING);
const app = express()
app.use(cors())
app.use(express.json());
HelloController(app)
UserController(app)
TuitsController(app);
app.listen(process.env.PORT || 4000)