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