Point the server at Greenlight
ScreenJSON files go straight in. Every other format is converted by Greenlight, so tell the server where it is:
docker run --rm -p 127.0.0.1:8080:8080 \
-e SCREENJSON_STORAGE_DRIVER=mongo \
-e SCREENJSON_STORAGE_URL=mongodb://mongo:27017 \
-e SCREENJSON_STORAGE_DATABASE=screenplays \
-e SCREENJSON_GREENLIGHT_SERVERS=greenlight:8080 \
-e SCREENJSON_GREENLIGHT_API_KEY=… \
ghcr.io/screenjson/screenjson-server:latest
GET /greenlight shows whether the server can reach it.
Upload
Send any number of files as multipart file parts, with a batch name to
group them:
S=http://127.0.0.1:8080
curl -s -X POST $S/imports -H "Authorization: Bearer $T" \
-F batch=season-2 \
-F [email protected] -F [email protected] -F [email protected] -F [email protected]
Or drag the files onto the Import page of the web app.
Follow them
curl -s "$S/imports?batch=season-2" | jq '.counts'
# {"done": 1, "converting": 3}
| Status | Meaning |
|---|---|
done | In the library. The record names the new document. |
converting | With Greenlight. Stored automatically when the job finishes. |
failed | With the reason: a file Greenlight couldn’t convert, or ScreenJSON that doesn’t validate. |
A whole back catalogue?
For thousands of files, convert them first and load them straight into the database with the free screenjson-db-importer, then start the server on the same database. It’s faster, resumable, and needs no upload.