-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (22 loc) · 787 Bytes
/
index.js
File metadata and controls
26 lines (22 loc) · 787 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
const express = require('express');
const cors = require('cors');
const app = express();
const port = 3000 || process.env.PORT;
const callerRouter = require('./routes/callers');
const callRouter = require('./routes/calls');
const localeRouter = require('./routes/locales');
const clinicRouter = require('./routes/clinics');
app.use(express.json());
//had to install cors to allow callback from external sources
var corsOptions = { origin: true };
app.use(cors(corsOptions));
app.get('/', (req, res) => {
res.json({message: 'Awaiting...'});
});
app.use('/callers', callerRouter);
app.use('/calls', callRouter);
app.use('/locales', localeRouter);
app.use('/clinics', clinicRouter);
app.listen(port, () => {
console.log(`RemoteCallServer listening at http://localhost:${port}`);
});