Frontend codes should be organized into one folder -> Public or Frontend or Static
This section would be where we add our html, css and script.js
Moving forward it is not required to use CORS anywhere due to the fact that we now have our own server. We are now able to use relative path (i.e. /tasks instead of having to add an additional url)
"===" is the syntax used to Check if an item is equal to something else, while "=" sets something equal to something else
I also learned that when using SQL, we cannot interpolate ${} columns into our SQL command because this will cause vulnerabilities in our backend to malicious activity. In order to avoid this, we can use ($1, $2, $3).
SQL
Below are a few examples of the commands we learned to query data using SQL:
Creating a new table:
CREATE TABLE tablename
(
Column_name 1 datatype serial PRIMARY KEY,
Column_name 2 datatype varchar(128) NOT NULL,
Column_name 3 datatype interger
);
Inserting data within table:
INSERT tablename (column1)
VALUE (value1)
In order to select all the data from within a table, we can use:
SELECT *
FROM table-name;
Deleting Data
DELETE tablename
WHERE (criteria);
Ordering Data
SELECT column1, column 2, column 3
FROM table-name
ORDER BY column1 AESC or DESC;
Updating data within a table:
UPDATE tablename
SET column1 = value1
WHERE (criteria);
Today I Learned:
Frontend codes should be organized into one folder -> Public or Frontend or Static
This section would be where we add our html, css and script.js
Moving forward it is not required to use CORS anywhere due to the fact that we now have our own server. We are now able to use relative path (i.e. /tasks instead of having to add an additional url)
"===" is the syntax used to Check if an item is equal to something else, while "=" sets something equal to something else
I also learned that when using SQL, we cannot interpolate
${}
columns into our SQL command because this will cause vulnerabilities in our backend to malicious activity. In order to avoid this, we can use ($1, $2, $3).SQL
Below are a few examples of the commands we learned to query data using SQL:
Creating a new table: CREATE TABLE tablename ( Column_name 1 datatype serial PRIMARY KEY, Column_name 2 datatype varchar(128) NOT NULL, Column_name 3 datatype interger );
Inserting data within table: INSERT tablename (column1) VALUE (value1)
In order to select all the data from within a table, we can use: SELECT * FROM table-name;
Deleting Data DELETE tablename WHERE (criteria);
Ordering Data SELECT column1, column 2, column 3 FROM table-name ORDER BY column1 AESC or DESC;
Updating data within a table: UPDATE tablename SET column1 = value1 WHERE (criteria);