diff --git a/BACK/hyeokim/app.js b/BACK/hyeokim/app.js new file mode 100644 index 0000000..ffd95bd --- /dev/null +++ b/BACK/hyeokim/app.js @@ -0,0 +1,10 @@ +const express = require('express') +const indexRouter = require('./routes/index'); +const app = express() +const port = 3000 + +app.use('/', indexRouter); + +app.listen(port, () => { + console.log(`Example app listening at http://localhost:${port}`) +}); \ No newline at end of file diff --git a/BACK/hyeokim/middleware/index.js b/BACK/hyeokim/middleware/index.js new file mode 100644 index 0000000..2703d30 --- /dev/null +++ b/BACK/hyeokim/middleware/index.js @@ -0,0 +1,6 @@ +function middleware(req, res, next) { + console.log('Time: ', Date.now()); + next(); +}; + +module.exports = middleware; \ No newline at end of file diff --git a/BACK/hyeokim/package.json b/BACK/hyeokim/package.json new file mode 100644 index 0000000..4fd81b0 --- /dev/null +++ b/BACK/hyeokim/package.json @@ -0,0 +1,15 @@ +{ + "name": "hyeokim", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "ejs": "^3.1.6", + "express": "^4.17.1" + } +} diff --git a/BACK/hyeokim/routes/index.js b/BACK/hyeokim/routes/index.js new file mode 100644 index 0000000..fd3dcb2 --- /dev/null +++ b/BACK/hyeokim/routes/index.js @@ -0,0 +1,13 @@ +const express = require("express"); +const router = express.Router(); +const middle = require("../middleware"); + +router.get("/", (req, res) => { + res.send("
Refresh and Check the console!
"); +}); + +module.exports = router; \ No newline at end of file