Crates.io | actix-web-nextjs-spa |
lib.rs | actix-web-nextjs-spa |
version | 0.1.1 |
source | src |
created_at | 2023-07-30 09:40:20.318517 |
updated_at | 2023-07-30 09:44:34.911415 |
description | Actix Web Next.js SPA service |
homepage | https://github.com/frysztak/actix-web-nextjs-spa |
repository | https://github.com/frysztak/actix-web-nextjs-spa |
max_upload_size | |
id | 929833 |
size | 26,397 |
Actix Web service for hosting statically exported Next.js apps.
This is a fork of Spa service from actix-web-lab with added support for Next.js dynamic routes.
It searches for Next.js's _buildManifest.js
and builds a tree of routes from it. Request to, e.g., /pet/dog/husky
resolves into /pet/[petType]/[breed].html
.
Exactly the same as original SPA service:
use actix_web::App;
use actix_web_nextjs_spa::spa;
let app = App::new()
// ...api routes...
.service(
spa()
.index_file("./web/spa.html")
.static_resources_location("./web")
.finish()
);
This project is licensed under either of the following licenses, at your option: