1.0.0 โข Published 2 years ago
@promenade/serve v1.0.0
@promenade/serve โจ๐งชโจ
@promenade/serve
is a toolkit for making basic HTTP servers for testing.
- ๐ Simple 1-function API!
- โก No-friction greased-lightning speed!
- ๐ Zero dependencies!
- ๐ก 100% Typescript!
Example
import serve from "@promenade/serve"
const { url, test, close } = serve({
'/': {
handler: () => 'hello!',
tests: { once: true }
},
}, { port: 8080 })
console.log(url) // http://localhost:8080
// do something that pings the server at the "/" route once.
// throws no error (unless it failed to ping)
test()
// close the server
close()
1.0.0
2 years ago