instaserve 0.1.17 → 0.1.18

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/module.mjs +2 -2
  2. package/package.json +1 -1
package/module.mjs CHANGED
@@ -18,7 +18,7 @@ export default function (routes, port = 3000) {
18
18
  r.on('end', (x) => {
19
19
  try {
20
20
  if (debug) console.log(`parsing data: "${data}"`)
21
- if (debug) console.log(`routes: "${routes}"`)
21
+ if (debug) console.log(`routes: "${JSON.stringify(routes)}"`)
22
22
  if (data) data = JSON.parse(data)
23
23
  const midware = Object.keys(routes)
24
24
  .filter((k) => k.startsWith('_'))
@@ -30,7 +30,7 @@ export default function (routes, port = 3000) {
30
30
  const url = r.url.split('/')[1]
31
31
  if (routes[url]) {
32
32
  const resp = routes[url](r, s, data)
33
- if(debug) console.log(`route: ${url}, returned: ${resp}`)
33
+ if(debug) console.log(`route: ${url}, returned: ${JSON.stringify(resp)}`)
34
34
  return s.end(typeof resp === 'string' ? resp:JSON.stringify(resp))
35
35
  }
36
36
  throw Error(r.url + ' not found')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instaserve",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Instant web stack",
5
5
  "main": "module.mjs",
6
6
  "bin": "./server.mjs",