27 lines
674 B
TypeScript
27 lines
674 B
TypeScript
import express from 'express';
|
|
import cors from 'cors';
|
|
import * as path from 'path';
|
|
import apiRouter from './src/api';
|
|
import bodyParser from 'body-parser';
|
|
|
|
const app = express();
|
|
const port = 5000;
|
|
|
|
app.use(cors())
|
|
app.use('/static', express.static(path.join(__dirname, 'static')))
|
|
// app.use(express.static(path.join(__dirname, 'static')))
|
|
// @ts-ignore
|
|
app.use(bodyParser.raw({ type: 'application/soap+xml' }));
|
|
app.use(bodyParser.json({ limit: '20mb' }));
|
|
// app.use(express.urlencoded({ extended: false }));
|
|
// @ts-ignore
|
|
app.use(express.json());
|
|
|
|
app.use('/api', apiRouter)
|
|
|
|
|
|
app.listen(port, () => {
|
|
console.log(`Arkids backend app start on port ${port}`);
|
|
});
|
|
|