Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1343ea0

Browse files
author
Alexander Zolotarov
committedAug 16, 2018
prefix support added
1 parent 4948c7f commit 1343ea0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎app.js

+4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ fs.readdirSync('./routes').forEach(function(file) {
3636
require(route)(app, db);
3737
});
3838

39+
//set prefix
40+
if(config.prefix) {
41+
app.use(config.prefix, app._router);
42+
}
3943

4044
function getIndexParams() {
4145
let params = [];

‎config.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"port": 8500
2+
"port": 8500,
3+
"prefix": "/api/v1"
34
}

0 commit comments

Comments
 (0)