deemix-gui/server/src/routes/index.ts

32 lines
607 B
TypeScript
Raw Normal View History

import express from 'express'
// @ts-expect-error
import { Deezer } from 'deezer-js'
import { sessionDZ } from '../main'
const router = express.Router()
/**
* GET home page
*
* @since 0.0.0
*/
router.get('/', (_, res) => {
2021-04-21 19:13:47 +00:00
res.render('index', { title: 'deemix' })
})
router.get('/connect', (req, res) => {
if (!sessionDZ[req.session.id]) sessionDZ[req.session.id] = new Deezer()
res.send({
update: {
currentCommit: "testing",
latestCommit: "testing",
updateAvailable: false,
deemixVersion: "3.0_beta"
},
autologin: true,
deezerNotAvailable: false
})
})
export default router