Update 2024 #1
1 changed files with 12 additions and 11 deletions
23
README.md
23
README.md
|
@ -4,20 +4,16 @@ Pure rust. Built with actix, diesel, tera, serde and sqlite3.
|
|||
|
||||
## Run instructions using docker
|
||||
|
||||
**TODO REWRITE, OUTDATED**
|
||||
|
||||
1. Clone the repository
|
||||
```bash
|
||||
git clone https://github.com/mtrx1337/crablog
|
||||
cd crablog/site
|
||||
```
|
||||
1. Clone this repository
|
||||
2. Install diesel and create a database
|
||||
```bash
|
||||
cd ./site
|
||||
cargo install diesel_cli --no-default-features --features "sqlite"
|
||||
diesel setup --database-url ../content/db.sqlite3
|
||||
diesel migration run --database-url ../content/db.sqlite3
|
||||
```
|
||||
3. Set up your configuration file (see below)
|
||||
3. Set up your configuration .env (see below)
|
||||
4. Pull the image (or build from source) and run the docker container
|
||||
```bash
|
||||
docker-compose up -d
|
||||
|
@ -50,15 +46,20 @@ CL_ROOT_PATH=/path/to/template/directory/and/sqliteDB
|
|||
| `/` | shows the last 5 posts |
|
||||
| `/id/<id>` | shows a single post by id |
|
||||
| `/all` | shows all posts |
|
||||
| `/submit` | set your submit token and create posts |
|
||||
| `/submit` | create posts using a web form |
|
||||
| `/edit>` | post selection page for editing |
|
||||
| `/edit/<id>` | edit, delete or hide posts |
|
||||
| `/about` | information about this blog, social media accounts |
|
||||
|
||||
**API Routes**
|
||||
|
||||
| Route | Description |
|
||||
| ---------------- | ------------------------- |
|
||||
| `api/blog/posts` | returns all posts as json |
|
||||
| Method | Route | Description |
|
||||
|---- | ---------------- | ------------------------- |
|
||||
| GET | `/api/blog/posts` | returns all posts as json |
|
||||
| POST | `/api/blog/create` | creates a post |
|
||||
| POST | `/api/blog/posts/edit/{post_id}` | edits a post |
|
||||
| POST | `/api/blog/posts/hide/{post_id}` | hides a post |
|
||||
| POST | `/api/blog/posts/delete/{post_id}` | deletes a post |
|
||||
|
||||
## Regenerate Migrations from Schema:
|
||||
|
||||
|
|
Loading…
Reference in a new issue