Skip to content

Commit

Permalink
Merge pull request #25 from lexara-prime-ai/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
irfanghat authored Jun 1, 2024
2 parents bf25a63 + 207af82 commit 1ed9165
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
workspace = { members = ["wspr_cdk_server"] }
[package]
name = "wspr_cdk"
version = "0.0.5"
version = "0.0.6"
edition = "2021"
authors = ["Irfan Ghat"]
description = "This crate provides an abstraction that allows you to do analysis on wspr's real time spot data."
Expand Down
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To use this crate, add `wspr_cdk` to your `Cargo.toml`:

```toml
[dependencies]
wspr_cdk = "0.0.5"
wspr_cdk = "0.0.6"
```

## Environment Variable
Expand Down Expand Up @@ -66,10 +66,8 @@ async fn main() {
### Example Query

```sh

Copy code
wget -q -O - "http://db1.wspr.live/?query=SELECT * FROM wspr.rx LIMIT 5 FORMAT JSON;"
```
wget -q -O - "http://db1.wspr.live/?query=SELECT * FROM wspr.rx LIMIT 5 FORMAT JSON;"`
``
### Sample Output
Expand Down Expand Up @@ -166,9 +164,8 @@ You can also fetch WSPR data using client-side JavaScript. Here is a sample impl
</head>
<body>
<div id="demo"></div>

<script> const content = document.getElementById("demo");
async function getData() {
let response = await fetch("http://localhost:8000/api/spots");
let raw = await response.json();
Expand All @@ -182,8 +179,8 @@ You can also fetch WSPR data using client-side JavaScript. Here is a sample impl
`;
}
}
getData(); </script>
getData();
</script>
</body>
</html>
```
Expand All @@ -204,6 +201,16 @@ Contributions are **welcome**! Please submit issues or pull requests as needed.

Special thanks to the WSPR community for providing access to the data and maintaining the infrastructure.

----------
## Docker Image

The `wspr_cdk` is also available as a Docker image:

```sh
docker pull lexaraprime/wspr_cdk:master
```

You can find it on Docker Hub: [lexaraprime/wspr_cdk](https://hub.docker.com/layers/lexaraprime/wspr_cdk/master/images/sha256-c869961d9a8413bf8ee562c3507632aeaa4b6e720a97792e7eef5ad984437872?context=repo)

---------------------------------

This documentation is also available as a crate on [crates.io](https://crates.io/)
59 changes: 59 additions & 0 deletions Rocket.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[default]
address = "0.0.0.0"
port = 8000
workers = 4
max_blocking = 512
keep_alive = 5
ident = "Rocket"
ip_header = "X-Real-IP" # set to `false` to disable
log_level = "critical"
temp_dir = "/tmp"
cli_colors = true
secret_key = "hPrYyЭRiMyµ5sBB1π+CMæ1køFsåqKvBiQJxBVHQk="

[default.limits]
form = "64 kB"
json = "500 MiB"
msgpack = "500 MiB"
"file/jpg" = "5 MiB"

[default.tls]
certs = "path/to/cert-chain.pem"
key = "path/to/key.pem"

[default.shutdown]
ctrlc = true
signals = ["term", "hup"]
grace = 5
mercy = 5

###################################

[release]
address = "0.0.0.0"
port = 8000
workers = 4
max_blocking = 512
keep_alive = 5
ident = "Rocket"
ip_header = "X-Real-IP" # set to `false` to disable
log_level = "critical"
temp_dir = "/tmp"
cli_colors = true
secret_key = "hPrYyЭRiMyµ5sBB1π+CMæ1køFsåqKvBiQJxBVHQk="

[release.limits]
form = "64 kB"
json = "500 MiB"
msgpack = "500 MiB"
"file/jpg" = "5 MiB"

[release.tls]
certs = "path/to/cert-chain.pem"
key = "path/to/key.pem"

[release.shutdown]
ctrlc = true
signals = ["term", "hup"]
grace = 5
mercy = 5
2 changes: 1 addition & 1 deletion src/services/session_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl SessionManager {
let timestamp = chrono::Utc::now().timestamp();

let BASE_URL = std::env::var_os("BASE_URL")
.expect("[BASE_URL] not found!")
.expect("[BASE_URL] not found, check [ENVIRONMENT VARIABLES]!")
.into_string()
.unwrap();

Expand Down
28 changes: 0 additions & 28 deletions wspr_cdk_server/Rocket.toml

This file was deleted.

0 comments on commit 1ed9165

Please sign in to comment.