Commit 845e3d6b authored by Lee Brown's avatar Lee Brown

fix readme web-api example

parent 0e3f18b2
......@@ -302,7 +302,7 @@ For more details on this service, read [web-api readme](
### Making Requests to Web API
Once the web-api service is running it will be available on port 3000.
The easiest way to make requests to the web-api service is by using CURL via your CLI.
......@@ -318,6 +318,15 @@ web-api service is running, it can be accessed at /docs
#### Initalize the database.
The database is created but does not include any schema when first started.
cd tools/schema/
source sample.env
go run main.go
#### Creating Initial User
Create an initial user service first using the signup endpoint documented at /docs
......@@ -353,7 +362,7 @@ Then click button Execute, which will return the CURL command and execute the ca
Example CURL command:
curl -X POST "" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"account\": { \"address1\": \"221 Tatitlek Ave\", \"address2\": \"Box #1832\", \"city\": \"Valdez\", \"country\": \"USA\", \"name\": \"Company 78d335d2-62a3-42a2-beff-148c63a2f5cd\", \"region\": \"AK\", \"timezone\": \"America/Anchorage\", \"zipcode\": \"99686\" }, \"user\": { \"email\": \"\", \"name\": \"Gabi May\", \"password\": \"SecretString\", \"password_confirm\": \"SecretString\" }}"
curl -X POST "" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"account\": { \"address1\": \"221 Tatitlek Ave\", \"address2\": \"Box #1832\", \"city\": \"Valdez\", \"country\": \"USA\", \"name\": \"Geeks on a Lake\", \"region\": \"AK\", \"timezone\": \"America/Anchorage\", \"zipcode\": \"99686\" }, \"user\": { \"email\": \"\", \"name\": \"Gabi May\", \"password\": \"SecretString\", \"password_confirm\": \"SecretString\" }}"
If successful, data should be returned for code 201.
......@@ -367,22 +376,23 @@ Before any authenticated requests can be sent you must acquire an auth token. Ma
your email and password to get an auth token.
$ curl --user "[email protected]:gophers"
curl --user "[email protected]:SecretString" -X POST
It is best to put the resulting token in an environment variable like `$TOKEN`.
#### Adding Token as Environment Variable
#### Authenticated Requests
To make authenticated requests put the token in the `Authorization` header with the `Bearer ` prefix.
$ curl -H "Authorization: Bearer ${TOKEN}"
curl -H "Authorization: Bearer ${TOKEN}"
......@@ -61,7 +61,7 @@ one `docker-compose.yaml` file that is shared between all services.
4. Open the Swagger UI.
Navigate your browser to [http://localhost:3001/docs](http://localhost:3001/docs).
Navigate your browser to [](
5. Signup a new account.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment