Fix build #189

Closed
deepbluemussel wants to merge 3 commits from fixBuild into master
2 changed files with 2 additions and 14 deletions
Showing only changes of commit 7415cc9a2a - Show all commits
-13
View File
@@ -1,13 +0,0 @@
FROM node:10.1.0-alpine
WORKDIR /app
COPY package.json /app/
COPY yarn.lock /app/
RUN yarn install --production && yarn cache clean
COPY . /app
ENV NODE_ENV production
ENTRYPOINT ["node", "-r", "esm", "./bin/server"]
+2 -1
View File
@@ -56,7 +56,7 @@ module.exports = function(opt) {
// root endpoint // root endpoint
app.use(async (ctx, next) => { app.use(async (ctx, next) => {
const path = ctx.request.path; const path = ctx.request.path;
console.log("new request",path)
// skip anything not on the root path // skip anything not on the root path
if (path !== '/') { if (path !== '/') {
await next(); await next();
@@ -119,6 +119,7 @@ module.exports = function(opt) {
server.on('request', (req, res) => { server.on('request', (req, res) => {
// without a hostname, we won't know who the request is for // without a hostname, we won't know who the request is for
const hostname = req.headers.host; const hostname = req.headers.host;
console.log("new on request",req.path,req.headers.host);
if (!hostname) { if (!hostname) {
res.statusCode = 400; res.statusCode = 400;
res.end('Host header is required'); res.end('Host header is required');