LibJF/docs/libjf-web-v0.md

19 lines
834 B
Markdown
Raw Normal View History

2022-01-05 11:54:03 +01:00
# libjf-web-v0
libjf-web-v0 provides an HTTP web server you can use in your serverside (and technically also clientside) mods
2022-01-05 11:54:03 +01:00
to serve web content through a unified port.
libjf-web-v0 depends on libjf-config-v1 to provide its config, libjf-base, fabric-lifecycle-events-v1 and fabric-command-api-v1
2022-01-05 11:54:03 +01:00
### Getting started
Implement WebInit and register it as a libjf:web entrypoint. To enable the server, also add the following to your fabric.mod.json:
```json
{
"custom": {
2022-01-05 11:54:03 +01:00
"libjf": {
"web": true
}
}
}
2022-01-05 11:54:03 +01:00
```
Please be aware that your entrypoint may be called multiple times during one session.
You can register content providers using the register* methods on the WebServer parameter of your entrypoint.
Please do not store it in a field, you may instead use WebServer.getInstance() if you wish to access it elsewhere.