@keshavsoft/kschema-cli 1.13.2 → 1.13.3

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.
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "KeshavSoft",
3
+ "version": "1.17.12",
4
+ "description": "",
5
+ "main": "app.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "start": "node --env-file=.env app.js"
10
+ },
11
+ "author": "",
12
+ "license": "ISC",
13
+ "dependencies": {
14
+ "@keshavsoft/kschema": "^1.17.12",
15
+ "body-parser": "^2.2.0",
16
+ "express": "^5.1.0"
17
+ },
18
+ "devDependencies": {
19
+ "@keshavsoft/kschema-api-gen": "^1.6.3"
20
+ }
21
+ }
@@ -0,0 +1,6 @@
1
+ export default function normalizePort(val) {
2
+ const port = Number(val);
3
+ if (Number.isNaN(port)) return val;
4
+ if (port >= 0) return port;
5
+ return false;
6
+ };
@@ -0,0 +1,5 @@
1
+ import express from "express";
2
+
3
+ export default function setupRoutes(app) {
4
+ app.use(express.static('Public'));
5
+ };
@@ -0,0 +1,13 @@
1
+ import http from "http";
2
+ import normalizePort from "./port.js";
3
+
4
+ export default function startServer(app) {
5
+ const port = normalizePort(process.env.PORT || 3000);
6
+ const server = http.createServer(app);
7
+
8
+ server.listen(port, () => {
9
+ console.log(`http://localhost:${port}`);
10
+ });
11
+
12
+ return { port }; // 👈 add this
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keshavsoft/kschema-cli",
3
- "version": "1.13.2",
3
+ "version": "1.13.3",
4
4
  "description": "CLI to scaffold projects using templates",
5
5
  "keywords": [
6
6
  "cli",