-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
22 lines (19 loc) · 769 Bytes
/
index.js
File metadata and controls
22 lines (19 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const connectionString = "postgres://postgres:123@localhost:5432/postgres";import express from 'express';
import pg from 'pg';
import meetups from './models/meetup';
import questions from './models/question';
import users from './models/user';
import routeMeetups from './controllers/meetup';
import routeusers from './controllers/user';
import routeQuestion from './controllers/question';
const app = express();
app.use(express.json());
app.use('/api/v1/meetups', routeMeetups);
app.use('/api/v1/users', routeusers);
app.use('/api/v1/questions', routeQuestion);
app.get('/', (req, res) => {
res.send('Welcome to my questioner app');
});
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`listening to port ${port}...`));
export default app;