add usage to README

This commit is contained in:
Arya Kiran 2023-01-08 09:24:34 +05:30
parent 3929036015
commit 11e5347391
No known key found for this signature in database
GPG Key ID: 3A6EA2D0EE314EEF
2 changed files with 24 additions and 14 deletions

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# PublAPI
PublAPI is a simple API for Project Segfault's public shared system (pubnix).
## Install
An installation of Go 1.19 or higher is required.
```
git clone https://github.com/ProjectSegfault/publapi
go mod download
go build
./publapi
```
By default it listens to port 3000 on 127.0.0.1. You can change the port with the environment variable PUBLAPI_PORT.
## 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 |
| /signup | POST | username, email | Creates a register script and notifies admins that a new registration request was sent |
|---------|------|-----------------|------------------------------------|

View File

@ -1,14 +0,0 @@
# Publapi
Publapi is a simple API for Project Segfault's public shared system (pubnix).
## Install
An installation of Go 1.19 or higher is required.
```
git clone https://github.com/ProjectSegfault/publapi
go mod download
go build
./publapi
```
By default it listens to port 3000 on 127.0.0.1. You can change the port with the environment variable PUBLAPI_PORT.