anvil/striker-ui-api/app.js

19 lines
454 B
JavaScript
Raw Normal View History

const cors = require('cors');
2021-11-29 22:48:55 +00:00
const express = require('express');
const path = require('path');
const API_ROOT_PATH = require('./lib/consts/API_ROOT_PATH');
2021-12-01 22:08:36 +00:00
const echoRouter = require('./routes/echo');
const filesRouter = require('./routes/files');
2021-11-29 22:48:55 +00:00
const app = express();
app.use(express.json());
app.use(cors());
2021-11-29 22:48:55 +00:00
2021-12-01 22:08:36 +00:00
app.use(path.join(API_ROOT_PATH, 'echo'), echoRouter);
app.use(path.join(API_ROOT_PATH, 'files'), filesRouter);
2021-11-29 22:48:55 +00:00
module.exports = app;