server.js
1013 Bytes
const express=require('express');
const bodyparser = require("body-parser");
const app = express();
const port = process.env.process || 5000;
app.use(bodyparser.json());
app.use(bodyparser.urlencoded({ extended: true}));
app.get('/api/students', (req, res)=>{
res.send([
{
'st_Code': 6666,
'st_Name': '육현진',
'st_Id': 2018102210,
'st_Major':'컴퓨터공학과',
'st_Midscore': 100,
'st_Finalscore': 100,
'st_Assignscore': 100,
'st_Attendscore': 100,
'st_Score':'A+'
},
{
'st_Code': 1111,
'st_Name': '김창동',
'st_Id': 2020021120,
'st_Major':'컴퓨터공학과',
'st_Midscore': 79,
'st_Finalscore': 85,
'st_Assignscore': 100,
'st_Attendscore': 90,
'st_Score':'A0'
}
]);
});
app.listen(port, () => console.log(`Listening on port ${port}`));