login.js 488 Bytes
const express = require("express");
const router = express.Router();

const { getPeed, getSubjects, login, close } = 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) {
    try {
      res.send("success");
    } catch (e) {
      console.log(e);
      res.send("error");
    }
  } else res.send("failed");
});

module.exports = router;