instaserve 0.1.15 → 0.1.16

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