fermyon / enterprise-architectures-and-patterns Goto Github PK
View Code? Open in Web Editor NEWCollection of Enterprise Architectures & Patterns built with Spin and WebAssembly
Collection of Enterprise Architectures & Patterns built with Spin and WebAssembly
When either of the SQLite apps (http-crud-go-sqlite or http-crud-js-sqlite) are run using an external libsql provider (specifically, Turso), things work fine for a spell but then after a little while of inactivity, STREAM_EXPIRED
and other errors result.
Not sure if this is specific to the provider (Turso) or the underlying sql libraries, or our use of them. I've repro'd on a local turso db as well as a remote turso db, but the steps below will use a local one.
To repro, launch a local turso db in one terminal and then spin up
one of the apps with runtime-config pointing to the db in another eg:
turso dev
[sqlite_database.default]
type = "libsql"
url = "http://127.0.0.1:8080"
token = ""
spin up --sqlite @migrations.sql --runtime-config-file runtime-config.toml
REST requests should work initially, but then after a period of time will fail, eg:
$ curl -X GET http://localhost:3000/items
io error: Hrana: `api error: `{"message":"The stream has expired due to inactivity","code":"STREAM_EXPIRED"}``
$ curl -X GET http://localhost:3000/items
io error: Hrana: `api error: `Received an invalid baton``
Here are logs from a turso db running locally:
$ turso dev
sqld listening on port 8080.
Use the following URL to configure your libSQL client SDK for local development:
http://127.0.0.1:8080
By default, no auth token is required when sqld is running locally. If you want to require authentication, use --auth-jwt-key-file to specify a file containing the JWT key.
This server is using an ephemeral database. Changes will be lost when this server stops.
If you want to persist changes, use --db-file to specify a SQLite database file instead.
2024-07-18T22:15:29.941091Z ERROR libsql_server::hrana::http: hrana server: Stream handle for 2342824010987366139 is expired
2024-07-18T22:29:49.898140Z ERROR libsql_server::hrana::http: hrana server: Stream handle for 2342824010987366139 was not found
All Spin Apps in this repo should be built using a GitHub Action. There are several events that should trigger the workflow:
Hi
Thanks for this repo. Really useful
I am compiling a Rust application that uses CORS.
I am getting the following error when using the build_with_cors
function:
.build_with_cors(&req, &load_cors_config()))
| ^^^^^^^^^^^^^^^ ---- ------------------- an argument of type `std::string::String` is missing
| |
| expected `&Method`, found `&Request`
It seems to want 3 arguments:
.build_with_cors(/* &spin_sdk::http::Method */, /* std::string::String */, &load_cors_config()))
Ref: https://github.com/fermyon/enterprise-architectures-and-patterns/blob/main/cors-rust/src/lib.rs#L57
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.