basic backend structure
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
import express, { Request, Response } from 'express';
|
||||
import express from 'express';
|
||||
import cors from 'cors';
|
||||
import { loaders } from './loaders';
|
||||
|
||||
const port = 8080;
|
||||
const app = express();
|
||||
app.use(cors());
|
||||
|
||||
app.get('/', (req: Request, res: Response) => {
|
||||
res.send('express');
|
||||
})
|
||||
|
||||
app.get('/hello', (req, res) => {
|
||||
res.send({ message: "hello from the server!!" });
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log('listening on ' + port);
|
||||
})
|
||||
(async function() {
|
||||
const app = express();
|
||||
await loaders(app);
|
||||
app.listen(port, () => {
|
||||
console.log('listening on ' + port);
|
||||
})
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user