Continue on Game view
[vchess.git] / server / routes / variants.js
1 // Get variants list (always needed)
2
3 let router = require("express").Router();
4 const createError = require('http-errors');
5 const VariantModel = require("../models/Variant");
6 const access = require("../utils/access");
7
8 router.get('/variants', access.ajax, function(req, res, next) {
9 VariantModel.getAll((err,variants) => {
10 if (!!err)
11 return next(err);
12 res.json({variantArray:variants});
13 });
14 });
15
16 module.exports = router;