Closed elnygren closed 5 years ago
Would be nice to release this change. Really appreciated.
Please release this change. Much appreciated!
Since this isn't published yet, someone should add another PR to return the server object from the index module, so that you can programmatically call:
server.close(function () {
console.log('Server shutdown.')
process.exit()
})
Could we get a release with this? Now that next includes an API system - it would be really nice to include dev output via the next runtime.
please release this change :) thanks
Hi! I wanted to submit an idea I'm using myself with
ts-node-dev
in a TypeScript + (Apollo) GraphQL project where I usemicro
as my server library.Problem
Using a
package.json
script such as the following:causes the process to crash on syntax errors etc. With
micro
this can be fixed by programmatically using micro:However, as we all know (https://github.com/zeit/micro/issues/337)
micro-dev
does not support programmatical usage. While many of the features are CLI specific, some are not.Solution
With this PR in place, one can do something like:
Comments
.listen
withinmicro-dev
when using the library like this. It would make this PR simpler and the usage a bit cleaner:It nothing else, this might act as a good reference for other micro & TypeScript users!
Cheers :)