GithubHelp home page GithubHelp logo

plumpmath / system-duct-style-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielsz/system-duct-style-example

0.0 0.0 0.0 12 KB

This demonstrates a project with two endpoints and middleware common to both

Clojure 100.00%

system-duct-style-example's Introduction

Multiple endpoints example with system

Definition

This is an example for the system library. It shows how to leverage the Duct components to build an application with multiple endpoints.

Mission statement

Names are important. What names? Those behind our favorite movies and our favorite books, that’s who! So let’s save them via a web service.

Installation

In our development environment, we use a in-memory database and a web server listening on port 3025.

$ boot dev

Or, if you don’t intend to connect with a REPL to the running system, type simply:

$ boot dev-run

In our production environment, we use a persistent database and a web server listening on port 8008.

$ boot prod-run

Usage

To add a director to our database:

curl -H "Content-Type: application/edn" -X PUT -d '{:director "Nagisa Ōshima"}' http://localhost:3025/director

To list directors in our database:

curl http://localhost:3025/directors
("Nagisa Ōshima")

To add an author to our database:

curl -H "Content-Type: application/edn" -X PUT -d '{:author "Albert Camus"}' http://localhost:3025/author

To list authors in our database:

curl http://localhost:3025/authors
("Alber Camus")

Lather, rinse and repeat.

system-duct-style-example's People

Contributors

danielsz avatar kajism 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.