박선진

Back-end/ 라우터, 서버 js 분리

const express = require('express');
const router = express.Router();
router.get('/', function(req,res) {
res.send({greeting: 'Hello React x Node.js'});
});
module.exports = router;
\ No newline at end of file
const express = require('express');
const app = express();
const api = require('./apiRouter');
app.use('/api', api);
const port = 3002;
app.listen(port, () => console.log(`노드서버 시작 : ${port}`));