Giter Site home page Giter Site logo

clojure-recipe-api's Introduction

recipe-api

A REST webservice to retrieve recipe source, name and url

Clojure Postgresql

Usage

create a database and user in postgresql on command line:

createdb recipes

run the user creation and table schema:

psql recipes <  resources/sql/create_recipes_table.sql

Load sample data in repl (update your host and credentials in models.clj)

(require '[recipie-api.sample-data])
(recipe-api.sample-data/load-test-data)
id |       name       |          url           |    source     |         created-at
----+------------------+------------------------+---------------+----------------------------
53 | Hard Boiled Eggs | www.hardboiledeggs.com | Mom           | 2015-02-07 08:35:43.349-06
54 | Grilled Cheese   | www.grilledcheese.com  | Ultra Foods   | 2015-02-07 08:35:43.377-06
55 | Sliced Bread     | www.slicedbread.com    | Bread for you | 2015-02-07 08:35:43.38-06
56 | Pizza            | www.pizza.com          | Good Recipes  | 2015-02-07 08:35:43.42-06
(4 rows)

Add your own recipes at the repl:

(add-recipe {:name "Rice & Chicken" :url "http://www.myrecipes.com/recipe/chicken-and-rice" :source "My Recipes"})

Add your recipe as TEST data

(add-recipe (testify-data {:name "Rice & Chicken" :url "http://www.myrecipes.com/recipe/chicken-and-rice" :source "My Recipes"}))

Delete all recipes with names starting with TEST

(delete-test-data)

run in development: lein ring server

view the json for all recipes index: localhost:3000/recipes

clojure-recipe-api's People

Contributors

rubygeek avatar bridgethillyer avatar

Watchers

James Cloos avatar Heggy Here avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.