@cilix/lightjs 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +6 -4
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -154,21 +154,23 @@ for (let i = 0; i < process.argv.length; i++) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
const PORT = process.env.PORT || config.port || 4477;
|
|
158
|
+
|
|
157
159
|
if (config.serve) {
|
|
158
160
|
http.createServer(light.router({
|
|
159
161
|
publicDir: config.publicDir || '.',
|
|
160
162
|
minify: true,
|
|
161
163
|
cache: true,
|
|
162
164
|
routes: config.routes
|
|
163
|
-
})).listen(
|
|
164
|
-
console.log(
|
|
165
|
+
})).listen(PORT, () => {
|
|
166
|
+
console.log(`Listening on port ${PORT}`);
|
|
165
167
|
});
|
|
166
168
|
} else if (config.dev) {
|
|
167
169
|
http.createServer(light.router({
|
|
168
170
|
publicDir: config.publicDir || '.',
|
|
169
171
|
routes: config.routes
|
|
170
|
-
})).listen(
|
|
171
|
-
console.log(
|
|
172
|
+
})).listen(PORT, () => {
|
|
173
|
+
console.log(`Listening on port ${PORT}`);
|
|
172
174
|
});
|
|
173
175
|
} else if (config.create) {
|
|
174
176
|
const p = path.resolve(dir, config.create);
|