express points to page

This commit is contained in:
Pablo Martin 2025-06-06 14:34:50 +02:00
parent d2d98c7a0f
commit a9e8fffd62

View file

@ -1,12 +1,17 @@
const express = require('express'); const express = require("express");
const path = require("path");
const app = express(); const app = express();
app.use(express.json()); const STATIC_DIR_PATH = path.join(__dirname, "../", "../", "dist", );
const INDEX_PATH = path.join(STATIC_DIR_PATH, "src", "front", "index.html");
app.get('/', (request, response) => { app.use(express.json());
response.status(200).send('elo fren!') app.use(express.static(STATIC_DIR_PATH));
})
app.get("/", (request, response) => {
response.sendFile(INDEX_PATH);
});
const PORT = 3003; const PORT = 3003;
app.listen(PORT, () => { app.listen(PORT, () => {