mirror of https://gitlab.com/ecentrics/concordia
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
569 B
20 lines
569 B
4 years ago
|
import express from 'express';
|
||
|
import cors from 'cors';
|
||
|
import initRoutes from './routes/web';
|
||
|
import { API_HOST, API_PORT } from './constants';
|
||
|
|
||
|
const app = express();
|
||
|
|
||
|
const corsOptions = {
|
||
|
origin: ['localhost:7000', '127.0.0.1:7000', 'http://localhost:7000'],
|
||
|
optionsSuccessStatus: 200, // some legacy browsers (IE11, various SmartTVs) choke on 204
|
||
|
};
|
||
|
|
||
|
app.use(express.urlencoded({ extended: true }));
|
||
|
app.use(cors(corsOptions));
|
||
|
|
||
|
initRoutes(app);
|
||
|
app.listen(API_PORT, () => {
|
||
|
console.log(`Contracts provider listening at http://${API_HOST}:${API_PORT}`);
|
||
|
});
|