pub struct Spa { /* private fields */ }
Expand description
Single Page App (SPA) service builder
§Examples
let app = App::new()
// API routes and other services
.service(
spa()
.index_file("dist/index.html")
.static_resources_mount("dist")
.static_resources_location("/")
.finish()
);
Implementations§
Source§impl Spa
impl Spa
Sourcepub fn index_file(self, index_file: impl Into<String>) -> Self
pub fn index_file(self, index_file: impl Into<String>) -> Self
Set the index file for the SPA
Sourcepub fn static_resources_mount(
self,
static_resources_mount: impl Into<String>,
) -> Self
pub fn static_resources_mount( self, static_resources_mount: impl Into<String>, ) -> Self
Set the mount point for static resources
Sourcepub fn static_resources_location(
self,
static_resources_location: impl Into<String>,
) -> Self
pub fn static_resources_location( self, static_resources_location: impl Into<String>, ) -> Self
Set the location for static resources
Sourcepub fn finish(self) -> impl HttpServiceFactory
pub fn finish(self) -> impl HttpServiceFactory
Finalize the configuration and return the SPA service
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spa
impl RefUnwindSafe for Spa
impl Send for Spa
impl Sync for Spa
impl Unpin for Spa
impl UnwindSafe for Spa
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more