mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-20 04:05:06 -04:00
wip
This commit is contained in:
parent
23c98589d1
commit
74cb0c9eab
4 changed files with 132 additions and 131 deletions
|
@ -9,8 +9,14 @@ app.use(bodyParser.text({
|
|||
limit:'1MB'
|
||||
}));
|
||||
|
||||
app.get('/src/data/levels.json', (req, res) => {
|
||||
console.log('src/data/levels.json')
|
||||
res.json(JSON.parse(fs.readFileSync('src/data/levels.json')))
|
||||
})
|
||||
|
||||
app.post('/src/data/levels.json', (req, res) => {
|
||||
if(req.body?.trim()) {
|
||||
console.log('Levels updated')
|
||||
fs.writeFileSync('src/data/levels.json', req.body)
|
||||
}
|
||||
res.end('OK')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue