forked from JamesQFreeman/PointRend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
31 lines (25 loc) · 889 Bytes
/
app.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
const express = require('express');
const image = require('express-image');
const path = require('path');
const cors= require("cors");
const cookieParser = require('cookie-parser');
const logger = require('morgan');
const indexRouter = require('./routes/index');
const resultRouter = require('./routes/result');
const evaluationRouter = require('./routes/evaluation');
const app = express();
app.use(cors({origin: 'https://ainize.ai'}));
console.log(path.join(__dirname, 'public'))
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({extended: false}));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
// console.lo
app.use('/imgs', image('/workspace/output/'));
app.use('/', indexRouter);
app.use('/result', resultRouter);
app.use('/eval', evaluationRouter);
const server = app.listen(80, () => {
});
module.exports = app;