- Project Kat
- 프로젝트 캣
목록Project <정리중>/TimeTube - Web Video (8)
This project is paused due to change of plan for doing frontend sector first. Will be resumed when I do use Node.js later.
res and req are objects? next is parameter??? Are they functions? These are middleware function. [res, req] are definitely middleware function. next is function - work somewhat like callback + middleware function. From documentation: You can provide multiple callback functions that behave like middleware to handle a request. The only exception is that these callbacks might invoke next('route') t..
Note. M = Data V = How does the data look like C = function which looks for the data So, why MVC all of sudden? To separate both 'URL' and 'function' for the sake of my mental health. By separating the URL sections to (1) another file with (2) another name of folder, let the folder name 'controller', and let that controller be the place to importing site for 'routers (folder)'. What this mean is..
To share the code contents of specific file (e.g. let app.js to share the code with init.js) Need to add 'export default app;' to the origin source. So, it can literally export so! 'export default app;' is the code. Then import it as follows: 'import app from "./app";' Now, here is all about 'routes'. How to use router? Router is the file which contains many route. 1. To let it work as router (d..