Skip to content

Commit 1a148aa

Browse files
committed
1.1.0, support HTTP_PREFIX
1 parent 422402c commit 1a148aa

File tree

6 files changed

+124
-158
lines changed

6 files changed

+124
-158
lines changed

.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:14-alpine
1+
FROM node:16-alpine
22

33
LABEL maintainer="i@i-meto.com"
44

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docker-ipdb",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"main": "server.js",
55
"repository": "git@github.com:metowolf/docker-ipdb.git",
66
"author": "metowolf <i@i-meto.com>",
@@ -13,16 +13,16 @@
1313
"@ipdb/range": "^0.1.1",
1414
"dotenv-flow": "^3.2.0",
1515
"ipdb": "^0.3.3",
16-
"koa": "^2.13.0",
17-
"koa-helmet": "^5.2.0",
16+
"koa": "^2.13.1",
17+
"koa-helmet": "^6.1.0",
1818
"koa-pino-logger": "^3.0.0",
19-
"koa-router": "^9.1.0",
19+
"koa-router": "^10.0.0",
2020
"koa2-cors": "^2.0.6",
21-
"pino": "^6.3.2",
22-
"pino-pretty": "^4.0.0",
23-
"qqwry.ipdb": "^2020.7.5"
21+
"pino": "^6.11.3",
22+
"pino-pretty": "^5.1.0",
23+
"qqwry.ipdb": "^2021.6.30"
2424
},
2525
"devDependencies": {
26-
"nodemon": "^2.0.4"
26+
"nodemon": "^2.0.9"
2727
}
2828
}

src/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require('dotenv-flow').config()
33
module.exports = {
44
http: {
55
port: parseInt(process.env.HTTP_PORT || 3000, 10),
6-
host: process.env.HTTP_HOST || 'localhost'
6+
host: process.env.HTTP_HOST || 'localhost',
7+
prefix: process.env.HTTP_PREFIX || ''
78
}
89
}

src/services/v1/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const Router = require('koa-router')
22
const qqwry = require('./qqwry/routes')
33
const ipip = require('./ipip/routes')
4+
const config = require('../../config')
45

56
const v1 = new Router({
6-
prefix: '/v1',
7+
prefix: `${config.http.prefix}/v1`,
78
})
89

910
v1.use(qqwry.routes())

0 commit comments

Comments
 (0)