How to send flash messages in Express 4.0?

后端 未结 6 2404
梦谈多话
梦谈多话 2020-11-28 03:26

So my web application requires authentication, and I have a signup page where if the person tries to sign up with an email that is already in the database, I want to show th

6条回答
  •  感情败类
    2020-11-28 04:08

    In my case if i put the message display part in another EJS file and import it in my layout, i get the success and error both displayed initially without any text since the pager just loaded

    _message.ejs

    <% if(success_msg) { %>
        
    <%= success_msg %>
    <% } %> <% if(error_msg) { %>
    <%= error_msg %>
    <% } %>

提交回复
热议问题