+Actix Web currently has a minimum supported Rust version (MSRV) of { rustVersion }. Running rustup update
will ensure you have the latest and greatest Rust version available. As such, this guide assumes you are running Rust { rustVersion } or later.
+
+Most importantly: Actix Web runs on Rust { rustVersion } or later and it works with stable releases. +
diff --git a/docusaurus.config.js b/docusaurus.config.js new file mode 100644 index 0000000..43a2d6e --- /dev/null +++ b/docusaurus.config.js @@ -0,0 +1,67 @@ +const path = require('path'); + +module.exports = { + title: 'Actix', + tagline: 'Actix Web is a powerful, pragmatic, and extremely fast web framework for Rust', + url: 'https://actix.rs', + baseUrl: '/actix-website/', + onBrokenLinks: 'throw', + onBrokenMarkdownLinks: 'warn', + favicon: 'img/logo.png', + organizationName: 'actix', // Usually your GitHub org/user name. + projectName: 'actix-web', // Usually your repo name. + themeConfig: { + navbar: { + title: 'Actix', + logo: { + alt: 'Actix Logo', + src: 'img/logo.png', + }, + items: [ + { + to: 'docs', + activeBasePath: 'docs', + label: 'Documentation', + position: 'left', + }, + { + to: 'community', + activeBasePath: 'community', + label: 'Community', + position: 'left', + }, + { + to: 'code', + activeBasePath: 'code', + label: 'Code', + position: 'left', + }, + ], + }, + footer: { + copyright: `Copyright © ${new Date().getFullYear()} The Actix Team`, + }, + prism: { + // dracula is closest to docs.rs, where keywords are highlighted + theme: require('prism-react-renderer/themes/dracula'), + additionalLanguages: ['rust', 'toml'], + defaultLanguage: 'rust' + } + }, + plugins: ["docusaurus-plugin-sass"], + presets: [ + [ + '@docusaurus/preset-classic', + { + docs: { + sidebarPath: require.resolve('./sidebars.js'), + editUrl: + 'https://github.com/actix/actix-website/edit/master/', + }, + theme: { + customCss: require.resolve('./src/css/custom.css'), + }, + }, + ], + ], +}; diff --git a/examples/databases/src/main.rs b/examples/databases/src/main.rs index 6d50adf..cbb1952 100644 --- a/examples/databases/src/main.rs +++ b/examples/databases/src/main.rs @@ -57,7 +57,7 @@ async fn index(pool: web::DataWhat you were looking for was not here
-We could not find the page you were looking for. This website was - recently restructured so maybe a link went dead. -
{{ .Description }}
- {{ end }} -↑ Back to code - {{ .Content }} -{{ end }} diff --git a/layouts/community/baseof.html b/layouts/community/baseof.html deleted file mode 100644 index 957e5a9..0000000 --- a/layouts/community/baseof.html +++ /dev/null @@ -1,23 +0,0 @@ -{{ partial "header" . }} -{{ $currentURL := .RelPermalink }} - -
{{ .Description }}
- {{ end }} -↑ Back to community - {{ .Content }} -{{ end }} diff --git a/layouts/docs/baseof.html b/layouts/docs/baseof.html deleted file mode 100644 index a6203da..0000000 --- a/layouts/docs/baseof.html +++ /dev/null @@ -1,123 +0,0 @@ -{{ partial "header" . }} -{{ $currentURL := .RelPermalink }} - -
{{ .Description }}
- {{ end }} -Forget about stringly typed objects, from request to response, everything has types.
- -- Out of the box logging, body compression, static file serving, TLS, HTTP/2, and - much more. -
- -Easily create and share reusable components for any Actix Web application.
- -Actix Web is blazingly fast. Don't take our word for it -- see for yourself!
-
- Handler functions in Actix Web can return a wide range of objects that
- implement the Responder
trait. This makes it a breeze
- to return consistent responses from your APIs.
-
- Actix Web comes with a powerful extractor system that extracts parts of the incoming - HTTP request and passes it to your handler functions. -
-
- A handler function can receive up to 12 arguments that implement the
- FromRequest
trait, in any order, and Actix Web will automatically extract
- them from the request and provide them. It feels like magic!
-
- Handling multipart/urlencoded form data is easy. Just define a structure that can be - deserialized and Actix Web will handle the rest. -
- {{ highlight `use actix_web::web::{Either, Json, Form}; - -#[derive(Deserialize)] -struct Register { - username: String, - country: String, -} - -// register form is JSON -async fn register(form: web::Json- The built-in Actix Web request router can be used with or without macros attached to - handlers, and always provides flexible and composable methods of creating routing - tables. -
-- Includes support for matching dynamic path segments, path prefix groups, and custom - routing guards which let you define your own rules. -
- {{ highlight `#[get("/")] -async fn index(_req: HttpRequest) -> impl Responder { - "Hello from the index page!" -} - -async fn hello(path: web::Path