feat: add JWT authentication
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
import express from 'express';
|
||||
import { env } from "./config/env.js";
|
||||
import { AppRoutes } from "./presentation/routes.js";
|
||||
import { Server } from "./presentation/server.js";
|
||||
|
||||
const app = express();
|
||||
const port = process.env.PORT ?? 3000;
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
app.get('/', (_req, res) => {
|
||||
res.json({
|
||||
message: 'API funcionando con Express + TypeScript + TSX',
|
||||
});
|
||||
async function main() {
|
||||
const server = new Server( {
|
||||
port : env.PORT,
|
||||
routes : AppRoutes.routes,
|
||||
});
|
||||
await server.start();
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Servidor corriendo en http://localhost:${port}`);
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user