const express = require("express");
const path = require("path");
const app = express();
app.get("/*", (req, res) => {
res.sendFile(path.resolve("frontend", "podroze.html"));
});
app.listen(process.env.PORT || 5060, () => console.log("Server running ...."));
Kod server.js
Kod w terminalu
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\t\WebstormProjects\untitled1\strona\podstrony\podstrony_podroz> npm install
npm WARN podstrony_podroz@1.0.0 No description
npm WARN podstrony_podroz@1.0.0 No repository field.
audited 50 packages in 0.657s
found 0 vulnerabilities
PS C:\Users\t\WebstormProjects\untitled1\strona\podstrony\podstrony_podroz> npm start
> podstrony_podroz@1.0.0 start C:\Users\t\WebstormProjects\untitled1\strona\podstrony\podstrony_podroz
> node server.js
Server running ....
Wpisując localhost:5060 dostaję powiadomienie w przeglądarce nie wiem jak zmienić w node_modules by plik nie otwierał index.html tylko podroze.html
(index):7288 crbug/1173575, non-JS module files deprecated.
(anonymous) @ (index):7288
https://github.com/ChrystianC/strona.git