Tidak Ada Deskripsi

jake kalstad 60660ddc7b Voila! 9 tahun lalu
src 60660ddc7b Voila! 9 tahun lalu
Cargo.toml 60660ddc7b Voila! 9 tahun lalu
README.md 60660ddc7b Voila! 9 tahun lalu
e2e.js 60660ddc7b Voila! 9 tahun lalu

README.md

USE MORE RUST

An implementation of a restful crud service in rust as a POC.

Tech

  • [Postgressql]
  • Redis

    API

    cargo run --verbose -- 3000 postgres://postgres:toor@127.0.0.1:5432/data

    User object represents both users and vendors

    curl -XPOST 127.0.0.1:3000/user -H "application/json" -d '{"id":"","name":"jake","password":"super secret", "email":"jake@jake.com","phone":"1239567","active":1,"products":[]}'
    
    curl 127.0.0.1:3000/user/key-goes-here
    
    curl 127.0.0.1:3000/users
    

product

Product object represents a ... product

curl -XPOST 127.0.0.1:3000/product -H "application/json" -d '{"id":"", "name":"MOUNTAIN DEWWWW", "price":"", "images":[]}'

curl 127.0.0.1:3000/product/key-goes-here

curl 127.0.0.1:3000/products

image

Image objects for users and products

curl -XPOST 127.0.0.1:3000/image -H "application/json" -d '{"id":"", "name":"Super dope haircut", "url":"http://i.imgur.com/oOtZe.jpg"}'

curl 127.0.0.1:3000/image/key-goes-here

curl 127.0.0.1:3000/images

price

Price for products

curl -XPOST 127.0.0.1:3000/price -H "application/json" -d '{"id":"", "user_id":"xxx", "product_id":"zzzz", "currency_code":"USD", "price":34}'

curl 127.0.0.1:3000/price/key-goes-here

curl 127.0.0.1:3000/prices

appointment

Appointment to exchance goods/services

curl -XPOST 127.0.0.1:3000/appointment -H "application/json" -d '{"id":"", "name":"xxx", "time":147324123, "confirmed":true, "user_id":"xxxx", "vendor_id":"xxxx", "product_id":"xxxx", "price_id":"xxxx"}'

curl 127.0.0.1:3000/appointment/key-goes-here

curl 127.0.0.1:3000/appointments