11 lines
340 B
TypeScript
11 lines
340 B
TypeScript
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}`)); |