Skip to content

drets/trypurescript

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PureScript API

Build Status

Very basic web service which wraps the PureScript compiler.

Client code

API

Compile PureScript code

POST /compile

  • Request body: PureScript code
  • Response body: Either { js: "..." } or { error: "..." }
  • Status code: 200 (success)

The response does not use error codes, to make it easier to use the API from another domain using CORS.

The output code will contain references to preloaded modules using require calls. To run these files in the browser, it is necessary to either use a require shim (such as require1k), or replace these calls and deploy a bundle of precompiled modules (the Try PureScript client uses the second approach).

Configuration

The application takes the following arguments on the command line:

  • port number
  • a list of input source files

Example

dist/build/trypurescript/trypurescript 8081 'bower_components/purescript-*/src/**/*.purs'

About

PureScript in the browser

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Haskell 63.3%
  • PureScript 29.9%
  • JavaScript 6.8%