Skip to main content

With Node HTTP

Example

server.ts
ts
import { initBridge, handler } from 'bridge';
 
const hello = handler({
resolve: () => 'hello',
});
 
const bridge = initBridge({ routes: { hello } });
 
const port = 8080;
 
bridge.HTTPServer().listen(port, () => {
`Listening on port ${port}`;
});
server.ts
ts
import { initBridge, handler } from 'bridge';
 
const hello = handler({
resolve: () => 'hello',
});
 
const bridge = initBridge({ routes: { hello } });
 
const port = 8080;
 
bridge.HTTPServer().listen(port, () => {
`Listening on port ${port}`;
});