instaserve 0.1.12 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instaserve",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Instant web stack",
5
5
  "main": "module.mjs",
6
6
  "bin": "./server.mjs",
package/routes.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export default {
2
- _debug: ({ method, url }, s) => !console.log(method, url),
3
- _example: (r, s) => console.log('returning a falsy value (above) will stop the chain'),
4
- api: () => 'an example api response'
5
- }
1
+ export default {
2
+ _debug: ({method, url}, s) => !console.log(method, url),
3
+ _example: (r, s) => console.log('returning a falsy value (above) will stop the chain'),
4
+ api: (r, s) => 'an example api response'
5
+ }
package/server.mjs CHANGED
@@ -5,8 +5,9 @@ import { pathToFileURL } from 'node:url'
5
5
  import { resolve } from 'node:path'
6
6
  import fs from 'node:fs'
7
7
  const routesfile = resolve(process.env.routes || 'routes.mjs')
8
+ const [npx, instaserve, cmd] = process.argv
8
9
 
9
- if (!fs.existsSync(routesfile)) {
10
+ if (cmd === 'create' && !fs.existsSync(routesfile)) {
10
11
  fs.writeFileSync(routesfile, `export default {
11
12
  _debug: ({method, url}, s) => !console.log(method, url),
12
13
  _example: (r, s) => console.log('returning a falsy value (above) will stop the chain'),