-
Notifications
You must be signed in to change notification settings - Fork 1
/
Documentation
31 lines (26 loc) · 2.01 KB
/
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
General:
APP folder: It has backend http stucture and some basic models that will be used in the project.
node_modules: This contains all the dependancies that are included with the ejs module.
public: The public side of teh website in which we will be pasting all the backend and frontend later.
resources: JS files, scss files and views
Routes: If some apis are used we will be keeping it there temporarily
package.json: ALl the modulels that are used in the project are included here and later added to the final project.
plan.txt: Plan for how are we going to proceed.
server.js: Creating an express server for the app.
yarn.lock: Autogenerated file
Why is nodemon used?
--> We dont need to clear the server over and over after we change the port numbers. If we are changign the port number in which we are hosting teh site we need to keep clearing the things out again and again. Nodemon does all of it realtime.
What is laravel and why is it used?
--> Webpack is used to basically prepare js assets for the browser.
The downside of using webpack directly is it has a learning curve which means we need to configure a lot of things.
Mix is like cream layer for the users. It uses a simple fluent api for webpack configuration.
--If your usecase is compiling js and using preprocessors for css then most of the work can be sorted by laravel mix.
Mix can target 80% of the usecases.
/Project-Pizza/server.js
Server.js file
Line 1: Firstly we are creating a variable express and adding express module into it.
Line 2: We are crating a new app by calling the function express(), which has an embedded createApplication function inside.
Line 3: PORT variable will be either assigned with process.env which is currently available environment port number or the port number will be 3000. In short we are setting sn environment variable.
Line
ejs
We are using .ejs file rather than .html file. It will have the same fucntionalities as the html file and moreover the variables from the server would be loaded into this file rather than normal html file.