You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
418 B
17 lines
418 B
// Servidor simple con Express que sirve el index y archivos estáticos
|
|
const express = require("express");
|
|
const path = require("path");
|
|
|
|
const app = express();
|
|
const PORT = process.env.PORT || 3000;
|
|
|
|
app.use(express.static(__dirname));
|
|
|
|
app.get("/", (req, res) => {
|
|
res.sendFile(path.join(__dirname, "index.html"));
|
|
});
|
|
|
|
app.listen(PORT, () => {
|
|
console.log(`Servidor iniciado en http://localhost:${PORT}`);
|
|
});
|