basic backend structure

This commit is contained in:
Mikayla Dobson
2022-11-17 15:26:01 -06:00
parent efef8ab2e8
commit 798da777a9
7 changed files with 147 additions and 38 deletions

View File

@@ -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);
})
})();