Skip to content

Commit 2e9d82b

Browse files
Fix path in cli
1 parent 413dc91 commit 2e9d82b

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

cli/index.cli.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const program = require('commander');
44
const colors = require('colors');
5+
const path = require('path');
56

67
const httpServer = require('http-server');
78
const apiServer = require('../src/server');
@@ -31,6 +32,8 @@ apiServer.run({
3132
webpackConfigFile: program.webpack
3233
});
3334

34-
httpServer.createServer({ root: './src/public/dist' }).listen(program.port, '127.0.0.1', () => {
35-
console.log(`Go to "Codecrumbs" client http://localhost:${program.port} `);
36-
});
35+
httpServer
36+
.createServer({ root: path.resolve(__dirname, '../src/public/dist') })
37+
.listen(program.port, '127.0.0.1', () => {
38+
console.log(`Go to "Codecrumbs" client http://localhost:${program.port} `);
39+
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codecrumbs",
3-
"version": "1.0.2-alpha",
3+
"version": "1.0.3-alpha",
44
"author": "Bohdan Liashenko",
55
"license": "MIT",
66
"repository": {

src/server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { SERVER_PORT, SOCKET_EVENT_TYPE } = require('../shared/constants');
77
const run = ({ projectDir, entryFile, webpackConfigFile }) => {
88
const httpServer = http.createServer(api.handleRequests(projectDir));
99
httpServer.listen(SERVER_PORT, () => {
10-
console.log(new Date() + `API server is listening: ${SERVER_PORT}.`);
10+
console.log(`API server is listening: ${SERVER_PORT}.`);
1111
});
1212

1313
const webSocketServer = new WebSocketServer({ httpServer });

0 commit comments

Comments
 (0)