1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-09 18:17:30 +00:00
cloudtube/server.js
2020-08-31 01:54:59 +12:00

28 lines
619 B
JavaScript

const {Pinski} = require("pinski")
const {setInstance} = require("pinski/plugins")
;(async () => {
await require("./api/utils/upgradedb")()
const server = new Pinski({
port: 8080,
relativeRoot: __dirname,
filesDir: "html"
})
setInstance(server)
server.addSassDir("sass", ["sass/includes"])
server.addRoute("/static/css/main.css", "sass/main.sass", "sass")
server.addPugDir("pug", ["pug/includes"])
server.addRoute("/", "pug/home.pug", "pug")
server.addStaticHashTableDir("html/static/js")
server.addStaticHashTableDir("html/static/js/elemjs")
server.addAPIDir("api")
server.startServer()
})()