오윤석

nodejs api router 추가

var express = require('express');
var app = express();
var bodyParser = require('body-parser');
let express = require('express');
let app = express();
let bodyParser = require('body-parser');
let routes = require('./routes');
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
var server = app.listen(80);
\ No newline at end of file
app.get('/api/home', routes.home);
let server = app.listen(80);
\ No newline at end of file
......
module.exports = function(req, res) {
res.send('this is home');
}
\ No newline at end of file
let routes = {};
routes.home = require('./home');
module.exports = routes;
\ No newline at end of file