Skip to content

Commit

Permalink
Add transport option to config
Browse files Browse the repository at this point in the history
  • Loading branch information
DemianParkhomenko committed Sep 14, 2023
1 parent bef3fba commit 25279de
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ module.exports = {
user: 'marcus',
password: 'marcus',
},
transport: 'http',
};
2 changes: 1 addition & 1 deletion src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ module.exports = (routing, port) => {
})
.listen(port);

console.log(`API on port ${port}`);
console.log(`API on http://localhost:${port}/`);
};
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

const fsp = require('node:fs').promises;
const path = require('node:path');
const server = require('./ws.js');
const config = require('./config.js');
const server = require(`./${config.transport}.js`);
const staticServer = require('./static.js');
const load = require('./load.js');
const db = require('./db.js');
const hash = require('./hash.js');
const logger = require('./logger.js');
const config = require('./config.js');

const sandbox = {
console: Object.freeze(logger),
Expand Down
2 changes: 1 addition & 1 deletion src/ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ module.exports = (routing, port) => {
});
});

console.log(`API on http://localhost:${port}/`);
console.log(`API on ws://localhost:${port}/`);
};

0 comments on commit 25279de

Please sign in to comment.