Skip to content

PartyLich/rs-hexmicro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hexagonal microservice example

A simple URL shortener ported from Go. It's a nice supplement to books and articles like Clean Architecture and in this case, the Rust Book (which I hadn't completed when wrote this).

I had done some research about the server frameworks available, then didn't have my notes available when I actually had time to implement that portion. I probably wouldn't choose Warp again for this little use case. The problems it seeks to solve aren't necessarily problems I've had, and the route composition style isn't meaningfully exploited here.

Building the docs

I haven't hosted them anywhere, so

cargo docs --no-deps --open

building the code

cargo build

trying it locally

# start respository
  redis-server
# start webserver with env variables for config
  URL_DB=redis REDIS_URL=redis://localhost:6379 cargo run
  URL_DB=mongo MONGO_DB=shortener MONGO_TIMEOUT=45 MONGO_URL="<mongodb connection string>" cargo run

then use GET and POST however you please (curl, postman, etc)

Contribute

Contributions are welcome. File an issue or PR.

About

basic Rust hex architecture url shortener example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages