const express = require('express');
const router = express.Router();
let data = [];
router.get('/', function (req, res) {
	let opt = {
		title: 'Express',
		data: data
	}
	res.render('index', opt);
});
router.post('/', function (req, res) {
	data.unshift(req.body.msg);
	res.redirect('/');
});
module.exports = router;