Crate ocean [] [src]

Ocean is a lightweight and intuitive web framework.

Examples

extern crate ocean;

use ocean::prelude::*;

fn main() {
    let mut app = ocean::app();

    app.router.get("/", index);

    app.listen("0.0.0.0", 3000);
}

fn index(_: Request, res: Response) {
    res.send(String::from("Hello world!"));
}

Modules

prelude

Ocean Prelude.

request

HTTP request

Structs

Application

Web application.

Enums

Error

Ocean Error

Functions

app

Shortcut function to create a web app.