Skip to main content
crate

crate


getting started

the below code will spawn a basic web server.

main.ts
const App = {
  directory: "./src",
  routes: {
    "/": "./index.html",
    "/redirect": "https://crate.land"
  }
}
            

import Crate from "https://crate.land/mod.ts";

const crate = new Crate(); crate.serve(App);


./src/index.html
<html>
  <main>
    hello from index.html!
    <br/>
    <Link to="https://crate.land/deno">
      Built with Crate!
      </Link>
  </main>
</html>