Step toward a one-page application
[vchess.git] / routes / index.js
1 // Main index page
2
3 let router = require("express").Router();
4 const VariantModel = require("../models/Variant");
5 const selectLanguage = require("../utils/language.js");
6
7 router.get('/', function(req, res, next) {
8 VariantModel.getAll((err,variants) => {
9 if (!!err)
10 return next(err);
11 res.render('index', {
12 variantArray: variants,
13 lang: selectLanguage(req, res),
14 });
15 });
16 });
17
18 module.exports = router;