go-recipes

command module
v0.0.0-...-8a7a009 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2016 License: MIT Imports: 7 Imported by: 0

README

Go Recipes

An Api to store recipes in Elastic Search

Run Elastic Search on port 9200.

docker run -d -p 9200:9200 -p 9300:9300 --name elasticsearch elasticsearch

Installation

Create a .env file in the root directory with the following values:

# App settings
APP_PORT=:7000
APP_VERSION=v1.0

# Elastic Search
ES_DOMAIN=localhost
ES_PORT=9200
ES_INDEX=recipe_index
ES_TEST_INDEX=test_index

Running the Application

To start the application you can use the run command.

$ make && make run

Add a recipe to the index:

curl -i -X POST \
  --url http://127.0.0.1:7000/api/v1.0/recipes \
  --data '{"title":"miso soup", "category":"asian", "ingredients":"miso, rice noodles, ginger", "instructions":"boil it for 60 minutes", "time": 60, "people": 2}'

Expected response:

HTTP/1.1 201 Created

Fetch all the recipes:

curl -i http://127.0.0.1:7000/api/v1.0/recipes

Expected response:

[{"id":"AVP_q_Xc6hie8WoeSicN","title":"miso soup","category":"asian","ingredients":"miso, rice noodles,noodles","instructions":"boil it for 60 minutes","time":60,"people":2}]

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