1
0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2024-11-14 04:17:29 +00:00
cloudtube/server.js

33 lines
818 B
JavaScript
Raw Normal View History

2020-08-22 13:17:31 +00:00
const {Pinski} = require("pinski")
const {setInstance} = require("pinski/plugins")
2020-08-30 13:54:59 +00:00
;(async () => {
await require("./utils/upgradedb")()
2020-08-22 13:17:31 +00:00
2020-08-30 13:54:59 +00:00
const server = new Pinski({
2020-08-31 13:24:34 +00:00
port: 10412,
2020-08-30 13:54:59 +00:00
relativeRoot: __dirname,
filesDir: "html"
})
2020-08-22 13:17:31 +00:00
2020-08-30 13:54:59 +00:00
setInstance(server)
2020-08-22 13:17:31 +00:00
2020-08-30 13:54:59 +00:00
server.addSassDir("sass", ["sass/includes"])
server.addRoute("/static/css/main.css", "sass/main.sass", "sass")
2020-08-22 13:17:31 +00:00
2020-08-30 13:54:59 +00:00
server.addPugDir("pug", ["pug/includes"])
server.addRoute("/", "pug/home.pug", "pug")
2021-01-12 12:13:46 +00:00
server.addRoute("/cant-think", "pug/cant-think.pug", "pug")
2020-08-22 13:17:31 +00:00
2020-08-30 13:54:59 +00:00
server.addStaticHashTableDir("html/static/js")
server.addStaticHashTableDir("html/static/js/elemjs")
2020-08-30 15:14:05 +00:00
server.addStaticHashTableDir("html/static/images")
server.addStaticHashTableDir("html/static/fonts")
2020-08-22 13:17:31 +00:00
2020-08-30 13:54:59 +00:00
server.addAPIDir("api")
server.startServer()
2020-08-31 13:22:16 +00:00
require("./background/feed-update")
2020-08-30 13:54:59 +00:00
})()