I am making google authentication using nodejs, express and passport. I am almost done but I have wrote a function where if the user is not logged in, then It should redirect to home page and it is not working. The code in router file is following:
var express = require('express');
var passport = require('passport');
var router = express.Router();
var User = require('../models/user.js');
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'sprinklrExchange' });
});
router.get('/ask', function(req, res, next) {
res.render('index2', { title: 'sprinklrExchange' });
});
router.get('/profile', function(req, res, next) {
res.render('profile.ejs', { user: req.user });
});
router.get('/auth/google', passport.authenticate('google', { scope : ['profile', 'email'] }));
// the callback after google has authenticated the user
router.get('/auth/google/callback',
passport.authenticate('google', {
successRedirect : '/profile',
failureRedirect : '/'
}));
router.get('/logout', function(req,res){
req.logout();
res.redirect('/');
});
function isLoggedIn(req, res, next) {
// if user is authenticated in the session, carry on
if (req.isAuthenticated()){
return next();
}
// console.log("hello world");
// if they aren't redirect them to the home page
res.redirect('/');
}
module.exports = router;
Whenever I am redirecting to localhost:3000/profile without logging in, it shows the following (instead redirecting me to homepage):
profile.ejs :
<!doctype html>
<html>
<head>
<title>Node Authentication</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<style>
body { padding-top:80px; word-wrap:break-word; }
</style>
</head>
<body>
<div class="container">
<div class="page-header text-center">
<h1><span class="fa fa-anchor"></span> Profile Page</h1>
Logout
</div>
<div class="row">
<!-- GOOGLE INFORMATION -->
<div class="col-sm-6">
<div class="well">
<h3 class="text-danger"><span class="fa fa-google-plus"></span> Google</h3>
<p>
<strong>id</strong>: <%= user.google.id %><br>
<strong>token</strong>: <%= user.google.token %><br>
<strong>email</strong>: <%= user.google.email %><br>
<strong>name</strong>: <%= user.google.name %>
</p>
</div>
</div>
</div>
</div>
</body>
</html>
Thanks in advance.
The reason for your problem is that:
when you access localhost:3000/profile without logging in, the req.user is undefined, so you cann't do user.google.id.
Related
app.js
const express = require('express');
const bodyParser = require('body-parser');
const ejs = require('ejs');
const mongoose = require('mongoose');
const app = express();
app.use(express.static('public'));
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', "ejs");
mongoose.set('strictQuery', false);
mongoose.connect("mongodb://localhost:27017/friendDB", { useNewUrlParser: true });
// Create Schema
const friendSchema = new mongoose.Schema({
email: String,
password: Array,
});
// Create Model through Schema
const Friend = new mongoose.model("Friend", friendSchema);
app.get('/', (req, res) => {
res.render("home");
})
app.get('/SignUp', (req, res) => {
res.render('SignUp');
})
app.get('/SignIn', (req, res) => {
res.render('SignIn');
});
app.get('/welcome', (req, res) => {
res.render('welcome');
})
// app.get("/signInFail", (req,res)=>{
// res.render("signInFail");
// });
app.post('/SignUp', (req, res) => {
// console.log(req.body.username);
// console.log(req.body.password);
const newFriend = new Friend({
email: req.body.username,
password: req.body.password,
confirmPassword: req.body.password
});
newFriend.save((err) => {
if (err) {
console.log(err);
} else {
res.render("welcome");
}
})
});
app.post('/SignIn', (req, res) => {
const username = req.body.username;
const password = req.body.password;
Friend.findOne({ email: username }, function (err, foundFriend) {
if (err) {
console.log(err);
} else {
if (foundFriend) {
if (foundFriend.password === password) {
res.render("welcome");
}
}
}
});
});
// app.post("/SignIn", (req,res)=>{
// const username = req.body.username;
// const password = req.body.password;
// Friend.findOne({email:username}, (err, foundFriend)=>{
// if(err){
// console.log(err);
// }else{
// if(foundFriend){
// if(foundFriend.password === password){
// res.render("welcome");
// }
// }
// }
// });
// });
app.listen(3000, () => {
console.log('server listening at port 3000');
})
welcome.ejs
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome</title>
<link rel="stylesheet" href="css/styles.css">
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>
<body class="text-center" style="margin:5% 35% 0 35%;">
<main class="form-signin w-100 m-auto">
<form>
<img src="./images/haikyyu main logo.png" alt="main_logo" height="150" width="150"
style="padding-bottom: 15px;border-radius: 100px;">
<h1 class="h3 mb-3 fw-normal">Hurray!</h1>
<h2>You've Signed In successfully😉.</h2>
<p class="mt-5 mb-3 text-muted">© 2022</p>
</form>
</main>
</body>
</html>
SignIn.ejs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<title>SignIn</title>
</head>
<body>
<body class="text-center" style="margin:5% 35% 0 35%;">
<main class="form-signin w-100 m-auto">
<form action="/SignIn" method="post">
<img src="./images/haikyyu main logo.png" alt="main_logo" height="150" width="150"
style="padding-bottom: 15px;border-radius: 100px;">
<h1 class="h3 mb-3 fw-normal">Sign-In</h1>
<div class="form-floating">
<input type="email" class="form-control" id="floatingInput" placeholder="name#example.com" name="username">
<label for="floatingInput">Email address</label>
</div>
<div class="form-floating" style="padding-top: 3px;">
<input type="password" class="form-control" id="floatingPassword" placeholder="Password" name="password">
<label for="floatingPassword">Password</label>
</div>
<div class="checkbox mb-3" style="padding-top:15px">
<label>
<input type="checkbox" value="remember-me"> Remember me
</label>
</div>
<div class="buttons" style="display: flex; justify-content: space-between;">
Sign Up
<button class="w-50 btn btn-lg" type="submit"
style="margin-left: 15px;background-color: rgb(236, 76, 18);color:aliceblue;">Sign In</button>
</div>
<p class="mt-5 mb-3 text-muted">© 2022</p>
</form>
</main>
</body>
</body>
</html>
It's not showing any error, it was working when I first tried it but after some time, when I tried to sign in with the same username and password the loader is just keep loading not showing the welcome page.
I think there is some problem in this code:
app.post('/SignIn', (req, res) => {
const username = req.body.username;
const password = req.body.password;
Friend.findOne({ email: username }, function (err, foundFriend) {
if (err) {
console.log(err);
} else {
if (foundFriend) {
if (foundFriend.password === password) {
res.render("welcome");
}
}
}
});
});
But I'm unable to figure out what it is.
So i'm trying to set this addpost page and i keep getting this "GET /posts/add 500 4.339 ms - 204" on my command prompt.
full code: https://github.com/vnkvp/blog
thanks for any feedback
this is my router/posts.js:
router.get('/add', (req, res, next)=>{
res.render('addpost', {
'title':'Add post'
});
});
module.exports = router;
and this is my app.js:
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use((req, res, next)=>{
req.db = db;
next();
});
app.use('/', indexRouter);
app.use('/posts', postsRouter);
//catch 404 and forward to error handler
app.use(function (req, res, next) {
next(createError(404));
});
//error handler
app.use(function (err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
//render the error page
res.status(err.status || 500);
res.render('error');
});
module.exports = app;
addpost.ejs file
<html>
<body>
<div class="container">
<h1>title</h1>
<ul class="errors">
<% if(errors) { %>
<% for (var i = 0; i < errors.length;i++) { %>
<li><%= errors[i].msg %></li>
<% } %>
<% } %>
</ul>
<form method="POST" action="/posts/add" enctype="multipart/form-data">
<div class="form">
<label>Title:</label>
<input type="text" name="title">
</div>
<div class="form">
<label>Category</label>
<input type="text" name="title">
</div>
</form>
</div>
</body>
</html>
In your call to res.render
res.render('addpost', {
'title':'Add post'
});
you are sending the variable title to your addpost.ejs view, but title is not used in that view. That view is trying to use an array called errors, but you haven't passed that array to the view so the following will fail:
<% if(errors) { %>
<% for (var i = 0; i < errors.length;i++) { %>
<li><%= errors[i].msg %></li>
<% } %>
<% } %>
Try something like this:
res.render('addpost', {
'title':'Add post',
'errors': ['test error1', 'test error2']
});
If you can see those test errors on your page then you just need to make sure you send the correct error to your view.
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>
Here's the only way you can show a popup swal
var express = require('express');
var router = express.Router();
router.post('/add', function(req, res, next) {
res.json("Hello world!")
});
<!DOCTYPE html>
<html lang="pt_br">
<head>
</head>
<body>
<h1 class="text-center title-1"> Cad </h1>
<form id="form" action="#" method="post">
<input type="submit" value="Save"/>
</form>
</body>
</html>
<script>
//import JQuery from script
//import swal script
$("#form").on("submit", function(e){
e.preventDefault();
$.ajax({
url: "/add",
method: "post"
}).done(d=>{
swal(e.responseJSON);
});
})
</script>
Here you can do using EJS
var express = require('express');
var router = express.Router();
router.post('/add', function(req, res, next) {
res.status(201).render('new', { isAdded : true } );
});
In HTML side
<% if (isAdded) { %>
<script>
Swal.fire(
'Good job!',
'Data saved',
'success'
)
</script>
<% } %>
In order to deal with this, you can use query parameters.
So, Here is what you can do
On the server
var express = require('express');
var router = express.Router();
router.post('/login', (req, res)=>{
res.redirect("/login?success=true&message=Logged In Successfully")
});
On the Client-Side (EJS)
<script>
var urlParams = new URLSearchParams(window.location.search);
if(urlParams.has('success') && urlParams.get('success')){
swal({
title: "Failed",
text: `${message}`,
icon: "error",
button: "Okay",
}).then(()=>{
console.log(window.location.hostname)
window.location.replace(window.location.origin + '/login');
})
}
This will simply popup swal. And you can toggle the value of success to render error and success messages.
I am trying to show a confirmation message before user deletes anything. I've tried following various related sources that I found in internet, but couldn't get them to work. I am using EJS template and Express 4.
app.js
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var users = require('./routes/users');
var app = express();
var flash = require('connect-flash');
var session = require('express-session');
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use('/js', express.static(__dirname + '/node_modules/bootstrap/dist/js')); // redirect bootstrap JS
app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css')); // redirect CSS bootstrap
// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(require('stylus').middleware(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'public')));
app.use(session({ secret: 'zxcv' })); // session secret
app.use(flash()); // use connect-flash for flash messages stored in session
app.use('/', routes);
app.use('/users', users);
// catch 404 and forward to error handler
app.use(function (req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handlers
// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
app.use(function (err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: err
});
});
}
// production error handler
// no stacktraces leaked to user
app.use(function (err, req, res, next) {
res.status(err.status || 500);
res.render('error', {
message: err.message,
error: {}
});
});
app.listen(8000);
module.exports = app;
index.js
var express = require('express');
var router = express.Router();
var searchModule = require('../crud_module/search.js');
var updateModule = require('../crud_module/update.js');
var deleteModule = require('../crud_module/delete.js');
/* GET home page. */
router.get('/', function (req, res) {
res.render('index', { title: '' });
});
router.post('/search-results', function (req, res) {
searchModule.search(req.body, function (data) {
res.render('index', { title: '', results: data });
});
});
router.post('/edit-data', function (req, res) {
searchModule.searchById(req.body, function (data) {
res.render('edit', { title: '', results: data });
});
});
router.post('/save-changes', function (req, res) {
if (req.body.change == "update") {
updateModule.saveChanges(req.body, function (err) {
if (err) {
res.render('edit', { message: req.flash('Error', 'Error Occured') });
} else {
//req.flash('success', 'Your name was updated');
res.render('edit', { message: req.flash('success', 'Data was updated')) });
}
res.redirect('/edit-data');
});
}
if (req.body.change == "delete") {
deleteModule.deleteRecord(req.body, function (data) {
res.render('edit', { title: 'Volume Tracker', confirmation: data });
});
}
});
module.exports = router;
edit.ejs
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<link href="node_modules/popups/css/popupS.min.css" rel="stylesheet" />
<script type="text/javascript" src="https://gc.kis.scr.kaspersky-labs.com/5B1FA715-F8FF-784F-A4C9-0D867337CB3D/main.js" charset="UTF-8"></script><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="node_modules/elasticsearch/src/elasticsearch.angular.js"></script>
<script src="node_modules/popups/dist/popupS.min.js"></script>
<script language="javascript">
</script>
<style type="text/css">
</style>
</head>
<body>
<br>
<form action='/save-changes' method='post'>
<div class="container">
<% if(locals.results) { %>
<table class="table table-bordered table-hover table-condensed">
<tr>
<th bgcolor="silver">Term Key</th>
<td>
<input name="termKey" value= "<%= results[0]._source.termkey %>" style="border:none; width:100%"/>
</td>
</tr>
<tr>
<th bgcolor="silver">Active</th>
<td>
<input name="active" value= "<%= results[0]._source.active %>" style="border:none; width:100%"/>
</td>
</tr>
<tr>
<th bgcolor="silver">Term Description</th>
<td>
<input name="termDescription" value= "<%= results[0]._source.termdescription %>" style="border:none; width:100%"/>
</td>
</tr>
</table>
<div align="center">
<button type="submit" class="btn btn-info" name="change" value="update"> Save Changes </button>
<button type="submit" class="btn btn-danger" name="change" value="delete"> Delete Record </button>
</div>
<% } %>
</form>
<br>
</div>
</body>
</html>
Here, when the user will click on the delete button, a confirmation message will be shown (here--> in index.js, I first tried showing confirmation message after user updates anything; which didn't work either). But whenever I try to include this:
<% if (message.length > 0) { %>
<div class="alert alert-danger"><%= message %></div>
<% } %>
in edit.ejs , I get error:
ReferenceError:
92| </form>
93| <br>
>> 94| <% if (message.length > 0) { %>
95| <div class="alert alert-danger"><%= message %></div>
96| <% } %>
message is not defined
at eval (eval at <anonymous> (\ElasticSearch\ES\VolumeTracker\VolumeTracker\node_modules\ejs\lib\ejs.js:495:12), <anonymous>:41:12)
at Template.compile.returnedFn (\ElasticSearch\ES\VolumeTracker\VolumeTracker\node_modules\ejs\lib\ejs.js:524:17)
at View.exports.renderFile [as engine] (\ElasticSearch\ES\VolumeTracker\VolumeTracker\node_modules\ejs\lib\ejs.js:378:31)
at View.render (\ElasticSearch\ES\VolumeTracker\VolumeTracker\node_modules\express\lib\view.js:76:8)
at Function.app.render (\ElasticSearch\ES\VolumeTracker\VolumeTracker\node_modules\express\lib\application.js:527:10)
at ServerResponse.res.render (\ElasticSearch\ES\VolumeTracker\VolumeTracker\node_modules\express\lib\response.js:900:7)
at \ElasticSearch\ES\VolumeTracker\VolumeTracker\routes\index.js:22:13
at \ElasticSearch\ES\VolumeTracker\VolumeTracker\crud_module\search.js:45:9
at tryCallOne (\ElasticSearch\ES\VolumeTracker\VolumeTracker\node_modules\elasticsearch\node_modules\promise\lib\core.js:37:12)
at \ElasticSearch\ES\VolumeTracker\VolumeTracker\node_modules\elasticsearch\node_modules\promise\lib\core.js:123:15
I have a simpler solution; as an example: after a succesful registration of a new user in the file routes/users.js:
req.flash('success_msg', 'You are registered and can now log in');
res.redirect('login');
In a file views/partials/_messages.ejs:
<% if (success_msg != '') { %>
<div class="alert alert__success"><%= success_msg %></div>
<% } %>
And in views/login.ejs include:
<% include ./partials/_messages %>
No other JavaScript needed!
I am posting here answer to my own question, in case anyone needs the same thing. To pass flash message to view, in your app.js ensure the following is present (note I am using ejs template for view) :
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var app = express();
var flash = require('connect-flash');
var session = require('express-session');
app.use(cookieParser());
app.use(session({ secret: 'zxcv' })); // session secret
app.use(flash()); // use connect-flash for flash messages stored in session
in your index.js
router.post('/edit', function (req, res) {
if (req.body.change == "update") { //if update btn is clicked
updateModule.saveChanges(req.body, function (err) { //call update module
if (err) {
//if error
req.flash("msg","Error Occured");
res.locals.messages = req.flash();
res.render('edit', { title: 'myApp'});
} else {
//on success
req.flash("msg", "Data updated successfully");
res.locals.messages = req.flash();
res.render('index', { 'title': 'myApp'});
}
});
}
});
and here is my view: for editing--> edit.ejs
<body>
<form action='/edit' method='post'>
<!--your data-->
<script language="javascript">
function UpdateConfirm() {
var userPreference;
if (confirm("Do you want to save changes?") == true) {
return true;}
else {
return false;}
}
</script>
<button type="submit" class="btn btn-info" name="change" value="update" onClick= "<%- "return UpdateConfirm()" %>" > Save Changes </button>
</form>
</body>
Here, if you click on the button, it will first popup a confirmation alert box (will call UpdateConfirm()), and if you click yes then it will submit the form.
Now, after updating I am passing flash message from my index.js. The view where you want to show the flash message, put this:
<% if (locals.messages) { %>
<script language="javascript">
alert("<%= messages.msg %>");
</script>
<% } %>
It will show the message in an alert box.
P.S: You have to install these npm packages: cookie-parser,connect-flash and connect-flash
I'm working with PassportJS and javascript to login and signup a new user. Then, after the signup part (which works perfectly), when I try to login I receive the page "Cannot POST /login". Can you help me understanding which is the error? Here is my code:
'use strict';
var express = require('express');
var router = express.Router();
var middleware = require('../middleware');
var rootUrl = require("../../config").url;
//supported methods
router.all('/', middleware.supportedMethods('GET, OPTIONS'));
// As with any middleware it is quintessential to call next()
// if the user is authenticated
var isAuthenticated = function (req, res, next) {
if (req.isAuthenticated())
return next();
res.redirect('/');
};
router.get('/library', isAuthenticated, function(req, res){
res.render('library', { user: req.user });
});
module.exports = function(passport){
/* GET login page. */
router.get('/', function(req, res) {
// Display the Login page with any flash message, if any
res.render('library');
});
/* Handle Login POST */
router.post('/users', passport.authenticate('users', {
successRedirect: '/library',
failureRedirect: '/'
}));
/* GET Registration Page */
router.get('/signup', function(req, res){
res.render('login');
});
/* Handle Registration POST */
router.post('/signup', passport.authenticate('signup', {
successRedirect: '/login',
failureRedirect: '/signup'
}));
return router;
};
And in the part of the dust (where I ask for the POST), I have the following code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="css/standardize.css">
<link rel="stylesheet" href="css/base.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body class="body login">
<div class="vertical-align-wrapper">
<div class="vertical-align-box">
<h1 class="slogan">We make your <i class="fa fa-heart beats pulse" style="color:#3b7cff;"></i> beats.</h1>
<div class="form-login-wrapper">
<form action="/login" method="POST" class="form-login">
<input class="form-control form-stacked" name="userName" placeholder="Username" type="text">
<input class="form-control form-stacked last" name="password" placeholder="Password" type="password">
<input class="btn btn-beats btn-block btn-stacked" value="Tune in" type="submit" id="submit">
</form>
<p>Don't have an account? <strong>sign up</strong> now! </p>
</div>
</div>
</div>
<h1 class="fat blue-glow bottom-right">Atelier<span class="pulse" style="display:inline-block;">Beats.</span></h1>
</body>
</html>
And here is my login code:
/** #module users/router */
'use strict';
var express = require('express');
var router = express.Router();
var middleware = require('../middleware');
var rootUrl = require("../../config").url;
//supported methods
router.all('/', middleware.supportedMethods('GET, OPTIONS'));
//list users
router.get('/', function(req, res, next) {
res.render('login');
});
/** router for /users */
module.exports = router;
Solution find:
/**
* Created by test on 12.12.14.
*/
var express = require('express');
var router = express.Router();
var middleware = require('../middleware');
var mongoose = require('mongoose');
var ObjectId = mongoose.Types.ObjectId;
var User = mongoose.model('User');
var config = require("../../config");
var session;
router.all('/', middleware.supportedMethods('GET, POST'));
router.get('/', function(req, res, next) {
res.render('login');
});
router.post('/', function (req, res) {
var post = req.body;
var query = User.where({userName : post.username});
query.findOne(function(err, user){
if (err) { return err}
if (user) {
user.isValidPassword(post.password, function(n, isMatch){
if(isMatch) {
req.session.user_id = user._id;
res.redirect('/library?' + user._id);
} else{
res.redirect('/login');
}
});
}else{
res.redirect('/login');
}
});
});
module.exports = router;