Service to run flux in the browser.
For development it is recommended to run the server and client separately
To run the server
$ cargo run -- --rustc-flux-path /path/to/rustc-flux
Alternatively, you can install cargo watch:
$ cargo install cargo-watch
and run the server with
$ cargo watch -x "run -- --rustc-flux-path /path/to-/rustc-flux"
This will start a server in port 3000.
Install dependencies
The first time you run the client you need to install the dependencies
$ cd client
$ npm install
Run vite server
$ cd client
$ npm run dev
This will start a server for the client with hot reload. It prints the URL where it is served.
To add an example put a file in the examples/ directory and then add an appropriate entry to config.yaml. Files are checked as if they were inside the lib/
directory, which means files in that directory can be declared as modules inside example files. See kmeans.rs
for an example that declares the rvec
module.
First run
$ ./install.sh
This will build the server and client, and then move all necessary files to ./dist
.
To start the server
$ cd dist
$ ./flux-playground --rustc-flux-path /path/to/rustc-flux