Giter Club home page Giter Club logo

deno-deploy-rust-template's Introduction

deno-deploy-rust-template

A template for creating Deno Deploy projects in Rust

Prerequisites

Prerequisites for usage without cargo-make

Usage

Note

If using cargo make, any commands requiring deno will attempt to install deno via cargo, if it is not already installed and in your $PATH. If you want to install deno via other means and haven't already, do so before running any cargo make commands.

Using this template

cargo generate gh:yoav-lavi/deno-deploy-rust-template

Building your project

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/

Deploying to Deno Deploy

Note

Create a new token in the Deno Deploy (under "Access Tokens") and use it in place of ... in DENO_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/"

Running your project with Deno

cargo make run
Manual command
deno run --allow-read --allow-net --allow-env src/index.ts

Running tests

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

deno-deploy-rust-template's People

Contributors

yoav-lavi avatar wezm avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.