const express = require('express');
const path = require('path');
const router = express.Router();

router.post('/echo', (req, res) => {
    const { name } = req.body;
    res.json({ message: `Hello, ${name}` });
});

router.get('/ruleset', (req, res) => {
    const filePath = path.join(__dirname, '../public/rulesets/1-basics-ruleset.json');
    res.download(filePath, '1-basics-ruleset.json');
});

module.exports = router;
