Created the api server
This commit is contained in:
parent
95f8bd7fff
commit
1aa963bdc9
11
server/api.ts
Normal file
11
server/api.ts
Normal 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}`));
|
Loading…
x
Reference in New Issue
Block a user