Scala and Akka streams REST blog engine. This Blogging engine follows the programming paradigm: Programming over Convention over Configuration, meaning that it provides only basic functionality, thus giving maximum flexibility for bloggers that are willed to do some programming on their own.
Live Demo: http://sandbox.sofen.de
This Engine has multiple sub blogs support. Each Blog has to be specified in the application.conf
:
blogs = {
nerds {
posts = "/path/to/blg-nerds/"
}
trailmagic {
posts = "/path/to/blg2/"
}
}
replace "nerds" with one of your blogs specified in application.conf
http://localhost:9000/v1/nerds/posts?compact=true&limit=2&offset=0&order=bydate&sort=asc
all parameters are optional and have default values...
Parameter | Meaning |
---|---|
compact=true | will trim post content at first empty newline (linux style). |
limit=10 | limit response to number of posts |
offset=0 | offset response list by number |
order=bydate | more to come |
sort=asc | sort (asc) ascending or (desc) descending |
start=0 | timestamp setting lower bound for post creation date |
stop=0 | timestamp setting upper bound for post creation date |
http://localhost:9000/v1/nerds/posts/by-tags/tag1,tag2?compact=true&limit=2&offset=0&order=bydate&sort=asc
http://localhost:9000/v1/nerds/posts/by-search/string to find in post?compact=true&limit=2&offset=0&order=bydate&sort=asc
This is probably the only filter method you need:
Example:
http://localhost:9000/v1/nerds/posts/filter/date:0,90000/tags:matlab,holiday?compact=true&limit=2&offset=0&order=bydate&sort=asc
Simply add filters to the query: /filter-name:param,list
filter | params | description |
---|---|---|
date | start,stop | return all posts between start and stop timestamp |
tags | tag1,tag2 | return all posts that have at least one of the given tags |
TODO:
- filter by author
- filter by text (fuzzy)
- filter by geo bounding box
Simple rss feed:
http://localhost:9000/v1/nerds/feed
{
"metadata": {
"title": "Fat Jar mit SBT Bauen",
"created": 1462912152,
"tags": ["sbt", "scala"],
"slug": "sbt_fatjar",
"coverImage": "~/data/img.jpeg"
},
"post": {
"content": "Bla bla bla"
}
Of course, a list of posts will be a json []
array.
#Interface See https://github.com/sebsofen/wren-gui for a gui using WREN
[include file="path/to/file"]
A ~ in the file path will be replaced by the current post slug.
Implementation of PostsRepository, CommentRepository, UserRepository. Each Blog can have own datasource for all three Repository types.