BlogSharer/expressHandler.js

23 lines
504 B
JavaScript
Raw Normal View History

2024-07-06 21:56:39 -05:00
const express = require("express"),
paths = require("./fileManager.js"),
pageUpdater = require("./pageUpdater.js"),
path = require("path"),
fs = require("fs")
const PORT = process.env.PORT || 8080
var app = express()
app.use(express.static(paths.static))
app.get("/", (req, res) => {
res.send(pageUpdater.root())
})
app.get('/post/:post*', (req, res) => {
res.send(pageUpdater.blogPost(req))
})
app.listen(PORT, () => {
console.log("Violet's Limbo is now listening on port: " + PORT)
})