login.js
431 Bytes
const express = require("express");
const router = express.Router();
const { getPeed, getSubjects, login } = require("../libs/E_Campus.js");
router.post("/", async (req, res) => {
console.log(`listened /login ${req.body.id} ${req.body.pw}`);
const page = await login(req.body.id, req.body.pw);
if (page) {
const peed = await getPeed(page);
res.send(peed);
} else res.send("failed");
});
module.exports = router;