You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.
Following the documentation, double checking the configuration and requirements. I even created a new project just to configure flash and have one route that does nothing but redirect to the next one whilst adding a flash message.
configure.swift
import Leaf
import Vapor
import Flash
/// Called before your application initializes.
publicfunc configure(_ config:inoutConfig, _ env:inoutEnvironment, _ services:inoutServices)throws{
/// Register providers first
try services.register(LeafProvider())try services.register(FlashProvider())
/// Register routes to the router
letrouter=EngineRouter.default()tryroutes(router)
services.register(router, as:Router.self)
/// Use Leaf for rendering views
config.prefer(LeafRenderer.self, for:ViewRenderer.self)
/// Register middleware
varmiddlewares=MiddlewareConfig() // Create _empty_ middleware config
middlewares.use(FileMiddleware.self) // Serves files from `Public/` directory
middlewares.use(ErrorMiddleware.self) // Catches errors and converts to HTTP response
middlewares.use(SessionsMiddleware.self)
middlewares.use(FlashMiddleware.self)
services.register(middlewares)}
Discussed here #26 and is something @siemensikkema has been looking into. I'm surprised that it is not mentioned in the readme - this should be added even though the requirement hopefully goes away soon.
This is still an issue - everything is setup, and nothing renders:
privatefunc loginHandler(_ request:Request)throws->Future<View>{returntry request.view().render("login", on: request)}
Has anything changed relating to this issue in the past year? I can see work going on, but the instructions in the readme seem incorrect, and #29/#34 haven't been merged.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The Flash package doesn't seem to work.
Following the documentation, double checking the configuration and requirements. I even created a new project just to configure flash and have one route that does nothing but redirect to the next one whilst adding a flash message.
configure.swift
routes.swift
welcome.leaf
Putting a breakpoint in the package at the check whether
flashes
isEmpty shows, it is empty.. 🤔The text was updated successfully, but these errors were encountered: