https://github.com/braid-org/host
A convenient host for Braid apps
https://github.com/braid-org/host
Last synced: 5 months ago
JSON representation
A convenient host for Braid apps
- Host: GitHub
- URL: https://github.com/braid-org/host
- Owner: braid-org
- Created: 2022-02-19T06:37:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-31T09:57:37.000Z (almost 4 years ago)
- Last Synced: 2025-10-21T22:56:40.601Z (8 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# `host`
A nice way to host Braid apps.
Example usage:
```javascript
var host = require('@braidjs/host')
host.route({ path: '/pub*', to: host.server('micropub') })
host.route({ path: '/*', to: host.server('invisible.college') })
console.log('Making the host!')
host.listen(443)
```
This short-form example assumes you have web servers implemented at `./micropub/server.js` and `./invisible.college/server.js`, but you can also specify an arbitrary directory and script with:
```javascript
host.route({ path: , to: host.server('directory', 'server.js') })
```
Or you can specify an existing server's port with:
```javascript
host.route({ path: , to: {name: '', port: } })
```