-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
27 lines (21 loc) · 715 Bytes
/
Copy pathserver.js
File metadata and controls
27 lines (21 loc) · 715 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
25
26
27
import { configDotenv } from 'dotenv';
import express from 'express';
import requestRouter from './routers/RequestRouter.js';
import volenteerRouter from './routers/VolenteerRouter.js';
configDotenv()
const app = express();
const hostname = process.env.HOST_NAME;
const port = process.env.PORT;
app.use(express.json());
app.use('/api/volenteers', volenteerRouter);
app.use('/api/helpRequests', requestRouter);
app.use('/', (req, res) => {
res.send('welcome to our volenteer api');
})
<<<<<<< HEAD
//error middlwere
=======
>>>>>>> ac625ac90f4f11b2e7a6a68fa41b78a422f0b0aa
app.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
})