Spaces:
Runtime error
Runtime error
View Root e instalacion de mongoose
Browse files- main.js +5 -2
- package.json +4 -3
- root.html +23 -0
main.js
CHANGED
|
@@ -7,12 +7,15 @@ let app = express();
|
|
| 7 |
const PORT = process.env.PORT || 7860;
|
| 8 |
|
| 9 |
// Uso middleware
|
| 10 |
-
app.use("/assets", express.static(`${__dirname}/public/assets`));
|
| 11 |
app.use(bodyParser.urlencoded({ extended: false }));
|
| 12 |
|
| 13 |
// Endpoints
|
|
|
|
|
|
|
|
|
|
| 14 |
app.get("/", (req, res) => {
|
| 15 |
-
res.sendFile(`${__dirname}/
|
| 16 |
});
|
| 17 |
|
| 18 |
app.listen(PORT, () => {
|
|
|
|
| 7 |
const PORT = process.env.PORT || 7860;
|
| 8 |
|
| 9 |
// Uso middleware
|
| 10 |
+
// app.use("/assets", express.static(`${__dirname}/public/assets`)); -- Usar con app corregida --
|
| 11 |
app.use(bodyParser.urlencoded({ extended: false }));
|
| 12 |
|
| 13 |
// Endpoints
|
| 14 |
+
// app.get("/", (req, res) => { -- Usar con app corregida --
|
| 15 |
+
// res.sendFile(`${__dirname}/public/index.html`);
|
| 16 |
+
// });
|
| 17 |
app.get("/", (req, res) => {
|
| 18 |
+
res.sendFile(`${__dirname}/root.html`);
|
| 19 |
});
|
| 20 |
|
| 21 |
app.listen(PORT, () => {
|
package.json
CHANGED
|
@@ -11,8 +11,9 @@
|
|
| 11 |
"author": "",
|
| 12 |
"license": "ISC",
|
| 13 |
"dependencies": {
|
| 14 |
-
"express": "^4.19.2",
|
| 15 |
"body-parser": "^1.15.2",
|
| 16 |
-
"cookie-parser": "^1.4.3"
|
|
|
|
|
|
|
| 17 |
}
|
| 18 |
-
}
|
|
|
|
| 11 |
"author": "",
|
| 12 |
"license": "ISC",
|
| 13 |
"dependencies": {
|
|
|
|
| 14 |
"body-parser": "^1.15.2",
|
| 15 |
+
"cookie-parser": "^1.4.3",
|
| 16 |
+
"express": "^4.19.2",
|
| 17 |
+
"mongoose": "^8.6.2"
|
| 18 |
}
|
| 19 |
+
}
|
root.html
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="es">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>API - Diabectec </title>
|
| 8 |
+
<link rel="stylesheet" href="https://unpkg.com/simpledotcss/simple.css">
|
| 9 |
+
</head>
|
| 10 |
+
|
| 11 |
+
<body>
|
| 12 |
+
<h1>Bienvenido a la app</h1>
|
| 13 |
+
<h3>Endpoinds disponbles</h3>
|
| 14 |
+
<p>Aun no hay endpoinds disponibles, estan en progreso o pausados</p>
|
| 15 |
+
<ul>
|
| 16 |
+
<li>No disponible</li>
|
| 17 |
+
<li>No disponible</li>
|
| 18 |
+
<li>No disponible</li>
|
| 19 |
+
<li>No disponible</li>
|
| 20 |
+
</ul>
|
| 21 |
+
</body>
|
| 22 |
+
|
| 23 |
+
</html>
|