Commit | Line | Data |
---|---|---|
582df349 BA |
1 | // Main index page |
2 | ||
298c42e6 | 3 | let router = require("express").Router(); |
8d7e2786 BA |
4 | const VariantModel = require("../models/Variant"); |
5 | const selectLanguage = require("../utils/language.js"); | |
298c42e6 BA |
6 | |
7 | router.get('/', function(req, res, next) { | |
8d7e2786 BA |
8 | VariantModel.getAll((err,variants) => { |
9 | if (!!err) | |
10 | return next(err); | |
11 | res.render('index', { | |
8d7e2786 BA |
12 | variantArray: variants, |
13 | lang: selectLanguage(req, res), | |
298c42e6 BA |
14 | }); |
15 | }); | |
16 | }); | |
17 | ||
18 | module.exports = router; |