Wrapscan Registry is a package registry for wraps (composable wasm modules).
The primary function of the registry is to facilitate the publishing of URIs, acting as the go-to source from where these wraps can be downloaded.
GET /- Home: get version of the registryGET /r/{user}/{package_and_version}- Get the latest version of the wrap- Returns:
- Body
{ name: "0.1.0", uri: "wrap://...", ... }
- Body
- Returns:
GET /v/{user}/{package}- Get package info- Returns:
- Body
{ id: "user_name/package_name", name: "package_name", ... }
- Body
- Returns:
GET /r/{user}/{package_and_version}/wrap.info- Get the published URI for the wrap- Returns:
- Header
x-wrap-uri: wrap://... - Status: 200
- Header
- Returns:
POST /r/{user}/{package_and_version}- Publish a URI for the wrap- Header:
Authorization: Bearer {base64 encoded API key} - Body:
{ uri: "wrap://..." }
- Header:
- nvm use
yarn dbto start the dbyarn devto start the serveryarn testto run the tests
You can also use the cargo commands directly in the gateway_service crate:
cargo run -F localto start the servercargo testto run the tests
All of the yarn commands run both for the feature flag local and without it.
We use #[cfg(feature = "local")] to switch between local and production code.
To run locally the feature flag local must be set. This will use a local database and server.
To get your editor working with the local flag, temporarily edit Cargo.toml and add the following:
[features]
default = ["local"]
rust/gateway_servicecontains the gateway service crate
src/main.rsis the entrypoint for the serversrc/setup_routescontains the server initialization and route registrationsrc/routescontains the route handlerssrc/functionscontains the raw functions the service supports (1:1 mapping to routes)src/constantscontains constants used throughout the servicesrc/modelscontains the models used throughout the service
src/dbcontains the database codesrc/db/local_db.rscontains setup for the local database, it only runs when thelocalfeature flag is setsrc/db/dynamodb.rscontains DynamoDbClient and PackageRepository implementations for the production database
src/debugging.rscontains debugging utilities- To help with debugging locally, two macros are available (note they only work when the
localfeature flag is set):debug!- is a wrapper arounddbg!.- It prints the file and line number of the debug statement as well as the value of the expression passed.
debug_println!- prints to stdout