Created the api server

This commit is contained in:
Mathias Wagner 2022-09-06 19:58:17 +02:00
parent 95f8bd7fff
commit 1aa963bdc9
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

11
server/api.ts Normal file
View File

@ -0,0 +1,11 @@
import express, {Express} from 'express';
const app: Express = express();
app.use(express.json());
/** Logs something with an api prefix */
const log = (msg: string) => console.log(`[API] ${msg}`);
/** Starts the api server */
export const startServer = (port: number = 8671) => app.listen(port, () => log(`Listening on port ${port}`));