express points to page
This commit is contained in:
parent
d2d98c7a0f
commit
a9e8fffd62
1 changed files with 10 additions and 5 deletions
|
|
@ -1,12 +1,17 @@
|
|||
const express = require('express');
|
||||
const express = require("express");
|
||||
const path = require("path");
|
||||
|
||||
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) => {
|
||||
response.status(200).send('elo fren!')
|
||||
})
|
||||
app.use(express.json());
|
||||
app.use(express.static(STATIC_DIR_PATH));
|
||||
|
||||
app.get("/", (request, response) => {
|
||||
response.sendFile(INDEX_PATH);
|
||||
});
|
||||
|
||||
const PORT = 3003;
|
||||
app.listen(PORT, () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue