Skip to content
Snippets Groups Projects
index.ts 797 B
Newer Older
import express, { Request, Response, NextFunction } from 'express';
import { json as bodyJson } from 'body-parser';
import fileupload from 'express-fileupload';
import { port } from './config';
import { addDefaultHeaders } from './headers';
app.use(addDefaultHeaders);
    res.status(404).json({
        status: 'error',
        message: 'unknown resource',
    });
app.use((err: Error, _req: Request, res: Response, _next: NextFunction) => {
    return res.status(400).json({
        status: 'error',
    console.log(`[server] Server is running at http://localhost:${port}`);