publapi/README.md

25 lines
979 B
Markdown
Raw Normal View History

2023-01-08 09:24:34 +05:30
# PublAPI
PublAPI is a simple API for Project Segfault's upcoming public shared system (pubnix).
2023-01-08 09:24:34 +05:30
## Install
An installation of Go 1.19 or higher is required.
```
git clone https://github.com/ProjectSegfault/publapi
go mod download
go build
./publapi
```
2023-01-08 14:50:40 +05:30
By default publapi listens on 127.0.0.1:3000. You can change the port with the environment variable PUBLAPI_PORT.
Additionally, you need to set the variable PUBLAPI_SHOUTRRRURL in order for notifications to work. Url Format can be found at https://containrrr.dev/shoutrrr/v0.5/services/matrix/
2023-01-08 09:24:34 +05:30
## Usage
Currently, PublAPI has only two routes, /online and /signup.
| ROUTE | TYPE | EXTRA ARGS | DESCRIPTION |
|---------|------|-----------------|------------------------------------|
| /online | GET | N/A | Returns the number of online users |
2023-01-17 20:39:46 +05:30
| /signup | POST | username, email, ssh | Creates a register script and notifies admins that a new registration request was sent.|