grocery-monkey-golang

command module
v0.0.0-...-a146ea6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 7 Imported by: 0

README

Grocery Monkey Go

docker run -it -p 3000:3000 -v $(pwd)/:/go/src [image id]

To run the server

root@6003e4f6a41c:/go/src# PORT=3000 go run main.go

To test the jwt token

wget --post-data 'username=kitty' http://localhost:PORT/sign -O-
Test create list
wget -O- --post-data='{"..."}' --header='Content-Type:application/json' --header='Authorization: Bearer ...' http://localhost:PORT/groceries
Update list
wget --method=PUT --body-data='{"user":"612f5471-6fa1-491f-8513-1695853ce6f9","subscribers":["1","2", "3"],"id":"b3ed8650-156a-4ad1-a144-1184d21e508e","groceries":[{"name":"Milk","qty":42,"unit":"Liters","store":"Wallmart"},{"name":"Beer","qty":100,"unit":"Bottles","store":"WholeFood"}]}' http://localhost:3001/groceries/update -O- --header='Content-Type:application/json' --header='Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImtpdHR5IiwidWlkIjoiNjEyZjU0NzEtNmZhMS00OTFmLTg1MTMtMTY5NTg1M2NlNmY5IiwiZXhwIjoxNjQ1OTA3NTU1fQ.nehX3te6X5xiSofiZSZx2D9Gm3MdnYZzc7qgesI7u7c'

docker run -it -p 3001:3001 -v $(pwd)/:/go/src -e DATABASE_URL=postgres://postgres:docker@172.17.0.2:5432/world?sslmode=disable 8f3b44ca1cea

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL