3

I'm trying to ask a type to a multiple flash message in Connect-Flash - Express and gives me multiple string messages but not "type"

In Route:

  app.get '/multiple-flash', (req, res) ->
    req.flash "info", ["Welcome", "Benvenuto"]
    res.redirect '/'

In client:

doctype 5
html
  head
    title= 'Login'

  body
    p layout

      if message 
        p= message

    -console.log(message)

GET /multiple-flash at localhost, but the output in the console does not show "type".

GET /multiple-flash 302 1ms - 90
[ [ 'Welcome', 'Benvenuto', ] ]

How can I fix? thanks

forier
  • 41
  • 3

1 Answers1

1

I hope it will be helpful to those who have had the same problem. In route '/' will be:

  app.get '/', (req, res) -> 
    res.render '', 
      message: req.flash() 

instead previously was wrong with:

message: req.flash ('info')

that returns only the flash of info.

forier
  • 41
  • 3