Skip to content

Commit

Permalink
Improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mewim committed Mar 11, 2024
1 parent 5260bca commit 18b32fb
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,27 @@ Please refer to the official Podman docs for [mounting external volumes](https:/

The Kùzu API server provides the following endpoints:

- `GET /`: Get the status of the server.
Example usage:
With `fetch` in JavaScript:
### `GET /`:

Get the status of the server.

#### Example usage:

** With `fetch` in JavaScript: **

```javascript
fetch("http://localhost:8000")
.then((response) => response.json())
.then((data) => console.log(data));
```

With `curl` in the terminal:
** With `curl` in the terminal: **

```bash
curl http://localhost:8000
```

Example response:
#### Example response:

```json
{
Expand All @@ -126,24 +130,27 @@ Example response:
}
```

- `GET /schema`: Get the schema of the database.
### `GET /schema`:

Get the schema of the database.

Example usage:
With `fetch` in JavaScript:
#### Example usage:

** With `fetch` in JavaScript: **

```javascript
fetch("http://localhost:8000/schema")
.then((response) => response.json())
.then((data) => console.log(data));
```

With `curl` in the terminal:
** With `curl` in the terminal: **

```bash
curl http://localhost:8000/schema
```

Example response:
#### Example response:

```json
{
Expand Down Expand Up @@ -207,10 +214,13 @@ Example response:
}
```

- `POST /cypher`: Execute a Cypher query and get the result. The request body should be a JSON object with a `query` field containing the Cypher query and an optional `params` field containing the parameters for the query (if the query is a parameterized query / prepared statement).
### `POST /cypher`:

Execute a Cypher query and get the result. The request body should be a JSON object with a `query` field containing the Cypher query and an optional `params` field containing the parameters for the query (if the query is a parameterized query / prepared statement).

#### Example usage:

Example usage:
With `fetch` in JavaScript:
** With `fetch` in JavaScript: **

```javascript
fetch("http://localhost:8000/cypher", {
Expand All @@ -229,7 +239,7 @@ fetch("http://localhost:8000/cypher", {
.then((data) => console.log(data));
```

With `curl` in the terminal:
** With `curl` in the terminal: **

```bash
curl -X POST\
Expand All @@ -238,7 +248,7 @@ curl -X POST\
http://localhost:8000/cypher
```

Example response:
#### Example response:

```json
{
Expand Down

0 comments on commit 18b32fb

Please sign in to comment.