A template for creating Deno Deploy projects in Rust
Note
If using
cargo make
, any commands requiringdeno
will attempt to installdeno
viacargo
, if it is not already installed and in your$PATH
. If you want to installdeno
via other means and haven't already, do so before running anycargo make
commands.
cargo generate gh:yoav-lavi/deno-deploy-rust-template
cargo make build-wasm
Manual command
rustup target add wasm32-unknown-unknown
&& cargo build --release --target wasm32-unknown-unknown
&& wasm-bindgen target/wasm32-unknown-unknown/release/{{crate_name}}.wasm --target deno --out-dir build/
Note
Create a new token in the Deno Deploy (under "Access Tokens") and use it in place of
...
inDENO_DEPLOY_TOKEN=...
If
~/.deno/bin
is not in your$PATH
, you will need to add it for this command to work
DENO_DEPLOY_TOKEN=... cargo make deploy
Manual command
deployctl deploy --token=... --project={{deno-deploy-project-name}} src/index.ts --exclude "target/"
cargo make run
Manual command
deno run --allow-read --allow-net --allow-env src/index.ts
cargo make test-rust
cargo make test-integration
Manual command
cargo test --target wasm32-unknown-unknown
deno test --allow-read --allow-net --allow-env tests/integration.ts