How to use sweetalert in nodejs?
问题 I have a nodejs code given with html code, I want to show a sweet alert on client side,after process a function in nodejs?. var express = require('express'); var router = express.Router(); const Swal = require('sweetalert2'); router.post('/add', function(req, res, next) { Swal('Hello world!'); }); <!DOCTYPE html> <html lang="pt_br"> <head> </head> <body> <h1 class="text-center title-1"> Cad </h1> <form action="/add" method="post"> <input type="submit" value="Save"/> </form> </body> </html>