4. Run the binary again and you're good to go, just browse to http://localhost:8080 (don't forget to replace `8080` with the port specified in your config)
When asked for a login, use whatever username you want and the password you provided during setup. Usage is pretty straightforward using the web UI, but here are some tips.
Send a PUT request with a JSON body following the following schemes. Don't forget to set the `Content-Type` header to `application/json` and the `Authorization` header to a valid value (username isn't important).
#### File
`PUT /f/id`
```json
{
"base64": "Base64-encoded file",
"filename": "Filename"
}
```
#### Link
`PUT /l/id`
```json
{
"forward": "URL to forward to"
}
```
#### Text
`PUT /t/id`
```json
{
"contents": "Text contents"
}
```
### Getting existing elements
The response will be a JSON array following the following schemes
#### Files
`GET /f`
```json
[
{
"id": "ID (URL) as an integer",
"filepath": "Absolute path to the stored file",
"created": "Creation timestamp"
}
]
```
#### Links
`GET /l`
```json
[
{
"id": "ID (URL) as an integer",
"forward": "URL to forward to",
"created": "Creation timestamp"
}
]
```
#### Texts
`GET /t`
```json
[
{
"id": "ID (URL) as an integer",
"contents": "Text contents",
"created": "Creation timestamp"
}
]
```
## Contributing
The project is open to contributions! Before submitting a PR, make sure your changes work both with and without the `dev` feature enabled.
### Requirements
* The Rust toolchain
* [diesel_cli](https://github.com/diesel-rs/diesel/tree/master/diesel_cli) with the `sqlite` feature enabled
### Setup
1. Copy [`.env.example`](./.env.example) to `.env` and set the variables to your liking
2. Run `diesel database setup`
3. Build or run with the `dev` feature enabled
## License
filite is licensed under the [MIT License](./LICENSE).