Skip to content

paoloo/ft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft

A simple clojure+clojurescript word scrambling test

Prerequisites

You will need Leiningen 2.0.0 or above installed.

Running

To start Clojure backend + Clojurescript frontend, just type

lein up

If, otherwise, want to startup the serices one by one:

  • To start the api server for the application, run: lein ring server
  • To start the same service but using a Heroku-style app: lein with-profile production trampoline run
  • To run just clojurescript: lein figwheel

Usage

  • Endpoint: POST /scramble
  • format: input: application/json, output: application/json
  • Parameters: word1, a set of characteres that should be verified if can be rearranged into word2.
  • exemples:

First, when first string characters can be rearranged to match the second one:

$ curl -XPOST -s -H 'Content-Type : application/json'\
       -d '{"word1":"rekqodlw", "word2":"world"}'\
       http://localhost:3000/scramble | jq '.'
{
  "scramble": true
}

Now, when it cannot:

$ curl -XPOST -s -H 'Content-Type : application/json'\
       -d '{"word1":"katas", "word2":"steak"}'\
       http://localhost:3000/scramble | jq '.'
{
  "scramble": false
}

Tests

lain test

License

Copyright © 2018 Paolo Oliveira

About

A simple clojure+clojurescript test

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published