Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,51 @@ | ||
# message-api | ||
|
||
|
||
[![Build](https://github.com/shoriwe/message-api/actions/workflows/build.yaml/badge.svg)](https://github.com/shoriwe/message-api/actions/workflows/build.yaml) | ||
[![codecov](https://codecov.io/gh/shoriwe/message-api/branch/main/graph/badge.svg?token=RU4KKCQPUV)](https://codecov.io/gh/shoriwe/message-api) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/shoriwe/message-api)](https://goreportcard.com/report/github.com/shoriwe/message-api) | ||
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/hidromatologia-v2/stations) | ||
|
||
REST API for [message-app](https://github.com/shoriwe/message-app) | ||
|
||
## Documentation | ||
|
||
| File | Description | | ||
| ------------------------------------------------ | ------------------------------------------ | | ||
| [docs/spec.openapi.yaml](docs/spec.openapi.yaml) | OpenAPI documentation for the REST service | | ||
| [docs/CLI.md](docs/CLI.md) | CLI documentation for the main binary | | ||
|
||
## Running | ||
|
||
### Docker | ||
|
||
```shell | ||
docker pull ghcr.io/shoriwe/message-api:latest | ||
``` | ||
|
||
### Docker compose | ||
|
||
Make sure to customize the [example.env](example.env) file. Then: | ||
|
||
```shell | ||
docker compose up -d | ||
``` | ||
|
||
### Binary | ||
|
||
You can find pre-compiled binaries at the [releases](https://github.com/shoriwe/message-api/releases) section. | ||
|
||
```shell | ||
export SECRET = "MY_SECRET" | ||
export FIREBASE_PROJECT_ID = "MY_FIREBASE_PROJECT" | ||
export FIREBASE_CONFIGURATION_FILE = "firebase-adminsdk.json" | ||
export DATABASE_FILE = "database.db" | ||
|
||
message-api :5000 | ||
``` | ||
|
||
#### Building from source | ||
|
||
```shell | ||
go install github.com/shoriwe/message-api@latest | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# CLI | ||
|
||
Documentation for the CLI | ||
|
||
## Environment variables | ||
|
||
| Variable | Description | | ||
| ----------------------------- | ---------------------------------------------------- | | ||
| `SECRET` | Secret for the JWT engine | | ||
| `FIREBASE_PROJECT_ID` | Project ID of the Firebase APP | | ||
| `FIREBASE_CONFIGURATION_FILE` | Firebase configuration file specific for the backend | | ||
| `DATABASE_FILE` | SQLite file path to use | | ||
|
||
## Command | ||
|
||
```shell | ||
message-api LISTEN_ADDR [LISTEN_ADDR [LISTEN_ADDR [...]]] | ||
``` | ||