Skip to content
This repository has been archived by the owner on Jun 26, 2018. It is now read-only.

SparkFund/vase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI

Clojars Project

Vase: Data-driven microservices

This system provides a data-driven and extensible way to describe and run HTTP APIs that are backed by a durable database (Datomic).

Vase should be considered beta technology

Vase has been used on real-world projects. Each new project teaches us something more about what Vase can do. We're continuing to improve its utility and usability. You may find some rough edges here and there. When you do, raise an issue so we can make it better.

Releases and Dependency Information

If you would like to use the latest developments in Vase, you will need to clone this repository and install it locally:

git clone https://github.com/cognitect-labs/vase
cd vase
lein install

Stable versions are currently deployed to the Clojars repository.

Leiningen dependency information:

 [com.cognitect/pedestal.vase "0.9.1"]

Maven dependency information:

<dependency>
  <groupId>com.cognitect</groupId>
  <artifactId>pedestal.vase</artifactId>
  <version>0.9.1</version>
</dependency>

Getting Started

By default, Vase uses an in-memory Datomic database, using the publicly available Datomic-free version located in Clojars.

Everything you need to get up and running with Vase is packaged in Vase itself. Vase is completely self-contained -- You don't need to setup Datomic or create a MyDatomic account.

Using the template

This repository also includes a Leiningen template for getting started. Look at the template's README for local/developer setup, otherwise

lein new vase my-service

Adding Vase to a Pedestal project

Vase turns API descriptions into Pedestal routes. The API descriptions specify actions for routes, these are turned into interceptors in the Pedestal routes. This is done by vase/routes.

vase/routes takes an API base URL and an API specification. The routes it returns can be used directly by Pedestal like this:

(require '[io.pedestal.http.route.definition.table :as table])
(require '[com.cognitect.vase]))

(defn make-master-routes
  [spec]
  (table/table-routes
   {}
   (vase/routes "/api" spec)))

The routes that vase/routes returns can also be combined with hand-written Pedestal routes by concatenating the input to table/table-routes:

(require '[io.pedestal.http.route.definition.table :as table])
(require '[com.cognitect.vase]))

(defn make-master-routes
  [spec]
  (table/table-routes
   {}
   (concat
     [["/hello" :get [hello]]]
     (vase/routes "/api" spec))))

Documentation

Contributing

Contributing guidelines for Vase are the same as Pedestal.

For code contribution, you'll need a signed Cognitect Contributor Agreement. For small changes and doc updates, no CA is required.

If you're proposing a significant change, please open an Issue to discuss the design of the change before submitting a Pull Request.

Copyright

Copyright © 2015-2017 Cognitect, Inc. All rights reserved.

Packages

No packages published

Languages

  • Clojure 99.4%
  • Shell 0.6%