Skip to content

Commit b8de2c2

Browse files
committed
Update README.md
1 parent dd402ad commit b8de2c2

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Very basic web service which wraps the PureScript compiler.
44

5+
[Client code](https://github.com/purescript/trypurescript/tree/gh-pages)
6+
57
## API
68

79
### Compile PureScript code
@@ -13,3 +15,25 @@ Very basic web service which wraps the PureScript compiler.
1315
- Status code: 200 (success)
1416

1517
The response does not use error codes, to make it easier to use the API from another domain using CORS.
18+
19+
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).
20+
21+
## Configuration
22+
23+
The application takes three arguments on the command line:
24+
25+
- externs path
26+
- externs config file
27+
- port number
28+
29+
### Externs Path
30+
31+
This directory should contain externs files for all modules which should be precompiled on startup. The name of each file in the directory should be `Module.Name.json`.
32+
33+
### Externs Config File
34+
35+
An example file is provided in `conf/core.conf`. A config file consists of a list of module names, one per line, topologically sorted by module dependencies and including all trasitive dependencies. The easist way to create this file is to copy the output of `psc` after a fresh compile.
36+
37+
### Example
38+
39+
dist/build/trypurescript/trypurescript externs/ conf/core.conf 8081

0 commit comments

Comments
 (0)