Giter Site home page Giter Site logo

kilo's Introduction

kilo Build Status

==== kilo

kilo. I wish to communicate with you.

A Clojure library designed to provide a RESTful interface to the VLACS data stored in a Moodle database.

Usage

Config

  1. Run dev-set-up.sh -- This script creates a ".kilo" directory in your home directory and populates it with a db config file and a web config file.

  2. Edit the config files per your environment. Set the db config file so that it has the info needed to connect to a Moodle test database. For my local env, I use ssh and port forwarding so that the //localhost:5433/moodletesttdolan_vlacs_org URL is actually hitting the moodletesttdolan_vlacs_org database on the VLACS test server.

Run

lein run -p ~/.kilo

Or, in development, fire up a REPL (either with lein or otherwise) and enter: (reset) at the REPL prompt. This will load all .clj files into the REPL and start a jetty instance running the kilo code.

Test

To confim, use curl, or other http request tool to submit requests to http://localhost:4001/kilo/user/1. Depending on the Accept header in the request, the response will be in either JSON or EDN formats. (Currently, if Accept header value is not specified to be application/json or application/edn, the response defaults to JSON.)

For example:

curl --header "Accept:application/edn" http://localhost:4001/kilo/user/34457 

Results in:

{:primary_sis_user_idstr nil, :can_masquerade 0, :timemodified 1376064004, :sis_user_id 1234, :timecreated 1324068264, :istest 0, :privilege "GUARDIAN", :sis_user_idstr "1234", :username "guser", :email "[email protected]", :firstname "Genie", :lastname "User", :id 12312, :password "cf23df2207d99a74fbe169e3eba035e633b65d94"}

And:

curl --header "Accept:application/json" http://localhost:4001/kilo/user/34457

Results in:

{"primary_sis_user_idstr":null,"can_masquerade":0,"timemodified":1376064004,"sis_user_id":1234,"timecreated":1324068264,"istest":0,"privilege":"GUARDIAN","sis_user_idstr":"1234","username":"guser","email":"[email protected]","firstname":"Genie","lastname":"User","id":12312,"password":"cf23df2207d99a74fbe169e3eba035e633b65d94"}

Currently, data being sent back is the raw response from the database query. Ultimate response format to be determined.

License

Copyright © 2014 VLACS http://vlacs.org

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

kilo's People

Contributors

tgdolan avatar moquist avatar

Watchers

 avatar James Cloos 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.