Have deleted commented out static files handling.
This commit is contained in:
parent
e0feb2eddf
commit
2d6f74e692
@ -3,7 +3,6 @@ const path = require("path");
|
|||||||
const Koa = require("koa");
|
const Koa = require("koa");
|
||||||
const koaPug = require("koa-pug");
|
const koaPug = require("koa-pug");
|
||||||
const koaRouter = require("koa-router");
|
const koaRouter = require("koa-router");
|
||||||
// const koaServe = require("koa-static");
|
|
||||||
const bodyParser = require("koa-body")({multipart: true});
|
const bodyParser = require("koa-body")({multipart: true});
|
||||||
const mysql = require("mysql");
|
const mysql = require("mysql");
|
||||||
const fetch = require("node-fetch");
|
const fetch = require("node-fetch");
|
||||||
@ -157,8 +156,6 @@ module.exports = () => {
|
|||||||
await ctx.render('500');
|
await ctx.render('500');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// .use(koaServe(path.join("static", "shared")))
|
|
||||||
// .use(koaServe(path.join("static", "dwelling")))
|
|
||||||
.use(dwelling_router.routes())
|
.use(dwelling_router.routes())
|
||||||
.listen(config.dwelling.port, config.dwelling.host);
|
.listen(config.dwelling.port, config.dwelling.host);
|
||||||
|
|
||||||
|
3
files.js
3
files.js
@ -5,7 +5,6 @@ const Koa = require("koa");
|
|||||||
const koaPug = require("koa-pug");
|
const koaPug = require("koa-pug");
|
||||||
const koaRouter = require("koa-router");
|
const koaRouter = require("koa-router");
|
||||||
const koaRange = require("koa-range");
|
const koaRange = require("koa-range");
|
||||||
//const koaServe = require("koa-static");
|
|
||||||
const FileType = require("file-type");
|
const FileType = require("file-type");
|
||||||
|
|
||||||
const config = require("./config");
|
const config = require("./config");
|
||||||
@ -139,8 +138,6 @@ module.exports = () => {
|
|||||||
app
|
app
|
||||||
.use(koaRange)
|
.use(koaRange)
|
||||||
.use(radio_router.routes())
|
.use(radio_router.routes())
|
||||||
// .use(koaServe(path.join("static", "shared")))
|
|
||||||
// .use(koaServe(path.join("static", "files")))
|
|
||||||
.on("error", err => { if (!err.code == ECONNRESET || !err.code == ENOENT) console.log(err.code); })
|
.on("error", err => { if (!err.code == ECONNRESET || !err.code == ENOENT) console.log(err.code); })
|
||||||
.listen(config.files.port, config.files.host);
|
.listen(config.files.port, config.files.host);
|
||||||
|
|
||||||
|
5
radio.js
5
radio.js
@ -4,7 +4,6 @@ const path = require("path");
|
|||||||
const Koa = require("koa");
|
const Koa = require("koa");
|
||||||
const koaPug = require("koa-pug");
|
const koaPug = require("koa-pug");
|
||||||
const koaRouter = require("koa-router");
|
const koaRouter = require("koa-router");
|
||||||
// const koaServe = require("koa-static");
|
|
||||||
const fetch = require("node-fetch");
|
const fetch = require("node-fetch");
|
||||||
|
|
||||||
const config = require("./config");
|
const config = require("./config");
|
||||||
@ -13,7 +12,7 @@ const util = require("./util");
|
|||||||
function setRoutes(router) {
|
function setRoutes(router) {
|
||||||
router.get('/', async ctx => {
|
router.get('/', async ctx => {
|
||||||
await ctx.render('index', {
|
await ctx.render('index', {
|
||||||
title: "/ Radio",
|
title: "/ Radio",
|
||||||
description: "Internet-radio broadcasting from under my desk.",
|
description: "Internet-radio broadcasting from under my desk.",
|
||||||
main_site: util.getServiceByHost(ctx.header.host)
|
main_site: util.getServiceByHost(ctx.header.host)
|
||||||
});
|
});
|
||||||
@ -54,8 +53,6 @@ module.exports = () => {
|
|||||||
|
|
||||||
app.proxy = true;
|
app.proxy = true;
|
||||||
app
|
app
|
||||||
// .use(koaServe(path.join("static", "shared")))
|
|
||||||
// .use(koaServe(path.join("static", "radio")))
|
|
||||||
.use(radio_router.routes())
|
.use(radio_router.routes())
|
||||||
.listen(config.radio.port, config.radio.host);
|
.listen(config.radio.port, config.radio.host);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user