Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flyingcakes85/static-serve-api
Simple static API for serving custom quotes! Primarily to serve custom quotes on my WIP homepage redesign.
https://github.com/flyingcakes85/static-serve-api
Last synced: 5 days ago
JSON representation
Simple static API for serving custom quotes! Primarily to serve custom quotes on my WIP homepage redesign.
- Host: GitHub
- URL: https://github.com/flyingcakes85/static-serve-api
- Owner: flyingcakes85
- License: mit
- Created: 2024-03-18T15:10:22.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-18T15:14:26.000Z (10 months ago)
- Last Synced: 2024-03-18T16:45:30.826Z (10 months ago)
- Language: Rust
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Static Serve API
A simple static API for serving custom quotes!
This is made primarily to serve custom quotes on my WIP [homepage](https://snehit.dev) redesign.
## Usage
Assuming the input data is contained in `data.yaml`, this command will emit quotes in `./public` folder.
```sh
./static-serve-api data.yaml
```Use `-o PATH` to alter the emit folder.
```sh
./static-serve-api data.yaml -o /web/static/quotes
```## Data file format
Input data file is expected to be in YAML format.
```yaml
path_prefix: "quotes"
quotes:
- text: "A beautiful quote."
author: "Author Name"
- text: "Another beautiful quote"
author: "Author Name"
custom_path: "collection"
```- `path_prefix`: (*string*) **optional** property, specifying a path prefix under the emit path provided on command line
- `quotes` (*array*) each element must have the following
- `text`: (*string*) the actual quote
- `author`: (*string*) author attributed
- `auto_id`: (*boolean*) **optional**, set false to disable auto-numbered file for the specific quote (this must be accompanies with a `custom_path`, otherwise the specific quote won't be emitted)
- `custom_id`: (*string*) **optional**, a custom name for the emitted file for the specific quote
- `custom_path`: (*string*) **optional**, an override to `path_prefix` for the specific quote## License
MIT