Skip to content

Instantly share code, notes, and snippets.

@g-k
Created September 10, 2012 02:04
Show Gist options
  • Save g-k/3688420 to your computer and use it in GitHub Desktop.
Save g-k/3688420 to your computer and use it in GitHub Desktop.
Datomic REST API Setup
# Download from: http://downloads.datomic.com/free.html
curl -O http://downloads.datomic.com/0.8.3488/datomic-free-0.8.3488.zip
unzip datomic-free-0.8.3488.zip
cd datomic-free-0.8.3488/
# From: http://docs.datomic.com/getting-started.html
# Run the transactor
bin/transactor config/samples/free-transactor-template.properties
# Should say:
# 'data-dir' property not set, defaulting to 'data' in current directory
# 'log-dir' property not set, defaulting to 'log' in current directory
# Starting datomic:free://localhost:4334/<DB-NAME>, storing data in: data ...
# System started datomic:free://localhost:4334/<DB-NAME>, storing data in: data
# Run the rest client with the datomic db uri from above (port could differ)
bin/rest 4619 test datomic:free://localhost:4334
# Should say:
# REST API started on port: 8081
# test = datomic:free://localhost:4334
# Go to: http://0.0.0.0:4619/ for an unstyled copy of http://docs.datomic.com/rest.html
# Make sure to replace storage with db alias set to test above
» http PUT http://0.0.0.0:4619/db/test/hello
HTTP/1.1 404 Not Found
Content-Length: 29
Date: Mon, 10 Sep 2012 03:36:55 GMT
Server: Jetty(7.6.5.v20120716)
For input string: "4334hello"
# Restart rest with trailing slash:
» bin/rest 4619 test datomic:free://localhost:4334/
REST API started on port: 4619
test = datomic:free://localhost:4334/
» http PUT http://0.0.0.0:4619/db/test/hello
HTTP/1.1 201 Created
Content-Length: 0
Date: Mon, 10 Sep 2012 03:37:39 GMT
Server: Jetty(7.6.5.v20120716)
@EdZilla
Copy link

EdZilla commented Dec 26, 2012

On line 17, I think you need the -p port switch as it:
bin/rest -p 4619 test datomic:free://localhost:4334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment