instaserve 0.1.22 → 0.1.23

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/module.mjs CHANGED
@@ -44,9 +44,8 @@ export default function (routes, port = 3000, ip = '127.0.0.1') {
44
44
  }
45
45
  throw Error(r.url + ' not found')
46
46
  } catch (e) {
47
- const err = JSON.stringify({error: e.message})
48
- console.log('Server error: ' + e)
49
- s.writeHead(404).end(err)
47
+ console.error(e.stack)
48
+ s.writeHead(500).end()
50
49
  }
51
50
  })
52
51
  }).listen(process.env.port || port, process.env.ip || ip)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instaserve",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "Instant web stack",
5
5
  "main": "module.mjs",
6
6
  "bin": "./server.mjs",
package/routes.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import url from 'node:url'
2
2
 
3
3
  export default {
4
+ /*_testerror: ()=>console.testerrors(),*/
4
5
  _debug: ({method, url}, s, data) => { console.log(method, url, data) },
5
6
  _example: (r, s) => console.log('returning a falsy value (above) will stop the chain'),
6
7
  api: (r, s, data) => 'an example api response, data:' + JSON.stringify(data),