LiteIPTV Server

node v6.17.1
version: 2.0.1
endpointsharetweet
const LiteIPTV = require('liteiptv') const express = require("@runkit/runkit/express-endpoint/1.0.0") const cors = require('cors') const bodyParser = require('body-parser') const app = express(exports) app.use(cors()) app.use(bodyParser.json()) app.get('/', (req, res) => { res.status(500).json({error: 'POST here with username/password'}) }) app.post('/', (req, res) => { if (!req.body.username) { return res.status(500).json({error: 'No username'}) } if (!req.body.password) { return res.status(500).json({error: 'No password'}) } const lite = new LiteIPTV(req.body.username, req.body.password) lite.panel() .then(p => res.json(p)) .catch(e => res.status(500).json({error: e})) })
Loading…

no comments

    sign in to comment