forked from OfficeDev/Microsoft-Teams-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
32 lines (24 loc) · 833 Bytes
/
server.js
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
28
29
30
31
32
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const express = require('express');
const bodyparser = require('body-parser');
const path = require('path');
const cors = require('cors');
const server = express();
server.use(bodyparser.urlencoded({ extended: false }))
server.use(bodyparser.json())
server.use(cors());
server.use(express.json());
server.use(express.urlencoded({
extended: true
}));
const ENV_FILE = path.join(__dirname, '.env');
require('dotenv').config({ path: ENV_FILE });
const port = process.env.port || process.env.PORT || 3000;
server.listen(port, function () {
console.log(`app listening on port ${port}!`);
});
// Parse application/json
server.use(express.json());
// Define route for the controller.
server.use('/api/chat', require('./controller'))