Skip to content

Commit

Permalink
start setup blogpost API tests and endpoints
Browse files Browse the repository at this point in the history
1. create create_post tests
2. create create_post endpoint
3. Adds method to database settings - connection with no db
4. fix up lib.rs and main.rs to handle sqlx PgPool connections

Signed-off-by: bayer <bayernator@protonmail.com>
  • Loading branch information
Bayernatoor committed Feb 1, 2024
1 parent a3d6b1d commit ed3ea51
Show file tree
Hide file tree
Showing 12 changed files with 2,196 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## used by sqlx:query! to ensure properly formatted queries at compile time.
DATABASE_URL="postgres://postgres:password@localhost:5432/blog"
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ serde = { version = "1.0.189", features = ["derive"] }
pulldown-cmark = { version = "0.9.3", features = ["serde"] }
tokio = { version = "1.33.0", features = ["macros"] }
config = "0.13.4"
uuid = {version = "1", features =["v4"] }
chrono = { version = "0.4.22", default-features = false, features = ["clock"] }


[dependencies.sqlx]
version = "0.7.3"
Expand All @@ -48,7 +51,7 @@ optional = true


[dev-dependencies]
reqwest = "0.11"
reqwest = { version = "0.11", features = ["json"] }
clippy = "0.0.302"

[features]
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# btc_self_custody

Something wonderful in the making
Website to help users self custody their bitcoin. Built using (Leptos)[https://github.com/leptos-rs/leptos] a Rust
webframe work library.

## Launching postgress db:

`./scripts/init_db.sh `
Loading

0 comments on commit ed3ea51

Please sign in to comment.