# Flux + URLEng

# Using Flux with URL Engine

### 👇 Ready? Get your own table in zero minutes ⏱️

You're about to create your very own serverless, storage persistent URL Engine table - fast, free and always accessible from anywhere. Since there are no logins or signups, all data is hidden in public. The only protection is your own **secret URL path**.

### Choose a unique URL path

We will use the Flux **HTTP Client** to query data _to/from_ our service.

Let's go through our examlpe using [FluxPipe](https://fluxpipe.fly.dev)

## Live Demo

> Replace `mY5uPeRs3Cre7tok3N` with your Token and click `Run`

<iframe src="https://fluxpipe.fly.dev/?user=default#aW1wb3J0ICJleHBlcmltZW50YWwvaHR0cC9yZXF1ZXN0cyIKaW1wb3J0IGVqc29uICJleHBlcmltZW50YWwvanNvbiIKaW1wb3J0ICJqc29uIgppbXBvcnQgImFycmF5IgoKdXJsZW5nID0gImh0dHBzOi8vdXJsZW5nLmNvbS9tWTV1UGVSczNDcmU3dG9rM04iCgpzdG9yZSA9CiByZXF1ZXN0cy5wb3N0KAogICAgICAgICB1cmw6IHVybGVuZyAsCiAgICAgICAgIGJvZHk6IGpzb24uZW5jb2RlKHY6IFt7ImtleSI6ImZsdXgiLCJ2YWx1ZSI6MTAwfV0pLAogICAgICAgICBoZWFkZXJzOiBbIkNvbnRlbnQtVHlwZSI6ICJhcHBsaWNhdGlvbi9qc29uIl0sCiAgICAgKQoKcmVzcG9uc2UgPQogICAgIHJlcXVlc3RzLmdldCgKICAgICAgICAgdXJsOiB1cmxlbmcgCiAgICAgKQoKZGF0YSA9IGVqc29uLnBhcnNlKGRhdGE6IHJlc3BvbnNlLmJvZHkpCmFycmF5LmZyb20ocm93czogZGF0YSk=" width=100% height=550></iframe>


## Flux Script

Here is the full Flux script for reference

```
import "experimental/http/requests"
import ejson "experimental/json"
import "json"
import "array"

urleng = "https://urleng.com/mY5uPeRs3Cre7tok3N"

store =
 requests.post(
         url: urleng,
         body: json.encode(v: [{"key":"flux","value":100}]),
         headers: ["Content-Type": "application/json"],
     )

response =
     requests.get(
         url: urleng
     )

data = ejson.parse(data: response.body)
array.from(rows: data)
```


### CURL
We can perform the same actions using curl or any other HTTP GET/POST client.

#### POST ndjson
```
curl -s -XPOST https://urleng.com/mY5uPeRs3Cre7tok3N-H 'Content-Type:application/x-ndjson' --data-binary @ndjson.txt
```
#### POST json
```
curl -X POST https://url-engine.metrico.in/mY5uPeRs3Cre7tok3N-H 'Content-Type: application/json' -d '[{"key":"curl","value":1}]'
``` 

#### GET json
```
curl -X GET https://urleng.com/mY5uPeRs3Cre7tok3N
```

<br>

## That's it

Enjoy your free, bottomless URL table! Use it to share small datasets, states, k/vs and anything you can think of between your nodes as if they were a distributed cluster.

💬 Found a problem? Got some feedback or ideas?<br>
Please open an Issue or start a Discussion in our community

🟨🟨🟨<br>
🟨🟨🟨<br>
🟥🟨🟨<br>

