22 lines
535 B
JavaScript
22 lines
535 B
JavaScript
const express = require("express")
|
|
const app = express()
|
|
const PORT = 3000
|
|
|
|
const path = require("path")
|
|
|
|
app.get("/", function(req, res) {
|
|
console.log("Ścieżka do katalogu głównego aplikacji: " + __dirname)
|
|
res.sendFile(path.join(__dirname, "/static/strona.html"))
|
|
})
|
|
|
|
app.get("/strona", function(req, res) {
|
|
res.sendFile(path.join(__dirname, "/static/strona.html"))
|
|
console.log(__dirname)
|
|
})
|
|
|
|
app.use(express.static('static'))
|
|
|
|
app.listen(PORT, function() {
|
|
console.log("Serwer uruchomiony, port " + PORT)
|
|
})
|