oplS15projects / WOLFRACKET

Racket Mathematics and Graphing REST API
0 stars 2 forks source link

WOLFRACKET

Authors

Jose Flores

Munkhjargal Narmandakh

Overview

To set up a racket Webserver with API landing points that interpret JSON input, which would then be processed by Racket to evaluated solutions. These solutions would then be returned by the webserver and in JSON form, images would be returned as links.

Screenshot

An image of the form input before a value is retrieved. screenshot showing env diagram

An image of the form input after an addition call. screenshot showing env diagram

Concepts Demonstrated

External Technology and Libraries

Favorite Lines of Code

Jose

This is my favorite piece of code because it was the hardest part of the puzzle to solve to create the server API that accessed GET variables.

I developed this through the extensive research and having to make a stackoverflow article, having to request external help to solve it.

The explanation of what I was trying to do is in the article.

The code does not use any specific OPL philosophies, except for using what is present and building up from it. I could have written a parser to extract the values I needed but this uses native procedures and structures to achieve the same result.

(define (get-param->string req param)
    (if (eq? #f (bindings-assq (string->bytes/utf-8 param)
                               (request-bindings/raw req)))
        ""
        (bytes->string/utf-8 (binding:form-value (bindings-assq (string->bytes/utf-8 param)
                                                               (request-bindings/raw req))))))

Munkhjargal

Description

MJ code here

How to Download and Run

  1. Clone the repository git clone https://github.com/oplS15projects/WOLFRACKET.git
  2. change directory to WOFRACKET/wolfracket/lib/ cd WOFRACKET/wolfracket/lib/
  3. Run racket driver.rkt
  4. In the web browser navigate to localhost:8080/home
  5. Chose a method in the dropdown and enter values
    • The method has a number of parameters it requires so (2) means the first two parameters),binary operations are in the form of 1st-param OPERATION 2nd-param, and unary are in the form of OPERATION( 1st-param )
  6. Submit entry for result