* Using `Views::BASE` and `Views::BASE_XL` str constants.
Using 4 spaces for indentation in sql files
Removing duplicate handlebar helpers. Handlebars by default supports helpers for bool ops. See <https://github.com/sunng87/handlebars-rust/blob/a970c28daaec820ae4ce6558195ce58f78b95081/src/helpers/helper_extras.rs#L11>
This templates prepares a starting point for a web server with axum
.
I use it for my personal projects and therefore it contains some opinionated choices.
It comes with a simple UI and assumes no authentication.
Some things to be aware of:
anyhow
for general errorsAppError
for web server errors that should be converted into an http statushandlebars
for templating
base
with a capped width container and base_xl
for full page containerGET /
assets
directory under /assets
route
GET /settings
POST /settings
application/x-www-form-urlencoded
body content typerusqlite
connection behind a mutex in web server's statemigrations
directoryCopy the .env.example
file to .env
.
Now you have two options: (a) run the server on host machine with $ cargo run
or (b) run it in a docker container.
For (b), install cross
to compile the project for the same target that this Dockerfile
uses.
Then run $ just up
or, if you don't have just
, look for the recipe with $ cat justfile
.
Finally, visit http://localhost:8000 in your browser.
Feel free to delete
Dockerfile.dev
,docker-compose.dev.yml
,Cross.toml
orjustfile
.