index.js
715 Bytes
var express = require('express')
var app = express()
var router = express.Router();
var path = require('path')
var profile = require('./profile/index')
var main = require('./main/main')
var register = require('./register/index')
var login = require('./login/index')
var logout = require('./logout/index')
var board = require('./board/index')
// URL routing
// req = request, res = respond
router.get('/', function(req, res){
res.sendFile(path.join(__dirname, "../public/main.html"));
});
// router 정의
router.use('/main', main)
router.use('/register', register)
router.use('/login', login)
router.use('/logout', logout)
router.use('/board', board)
router.use('/profile',profile)
module.exports = router;