atomic-server
Status: alpha, not ready for production usage. Can panic at runtime.
The easiest way to share Atomic Data on the web. Demo on atomicdata.dev
Powered by Rust, atomic_lib, actix-web, Sled and more.
Install Cargo to build from source.
```sh git clone git@github.com:joepio/atomic.git cd atomic/server
cp default.env .env
cargo run
```
You can also install with cargo install atomic-server
, but this binary will also require:
/templates
directory/static
directory.env
from this repo, (if you need modifications).Check out ./example_requests.http for various HTTP requests to the server.
You can fetch individual items by sending a GET request to their URL.
```sh
curl -i -H "Accept: application/ad3-ndjson" http://127.0.0.1:8081/test
curl -i -H "Accept: application/ld+json" http://127.0.0.1:8081/test
curl -i -H "Accept: application/json" http://127.0.0.1:8081/test
curl -i -H "Accept: text/turtle" http://127.0.0.1:8081/test ```
```sh
curl -i -H "Accept: application/ad3-ndjson" "http://127.0.0.1:8081/tpf?subject=&property=&value=test" ```
You'll probably want to make your Atomic Data available through HTTPS.
You can use the embedded HTTPS / TLS setup powered by LetsEncrypt, acme_lib and rustls.
To setup HTTPS, we'll need to set some environment variables.
Open .env
and set:
env
ATOMIC_EMAIL=youremail@example.com
ATOMIC_DOMAIN=example.com
Run the server cargo run
.
Make sure the server is accessible at ATOMIC_DOMAIN
at port 80, because Let's Encrypt will send an HTTP request to this server's /.well-known
directory to check the keys.
It will now initialize the certificate.
Read the logs, watch for errors.
HTTPS certificates are automatically renewed when the server is restarted, and the certs are 4 weeks or older.
```sh
cargo test --all ```
```sh
cargo install drill drill -b benchmark.yml --stats ```