A learning exercise in client and server side security.
- node 14.17.0
- npm 6.14.13
Client: HTML, CSS
Server: Node, Express
Clone the project
git clone https://github.com/JRPerezJr/complete-junior-to-senior-security-client-server-exercise.git
Go to the project directory
cd complete-junior-to-senior-security-client-server-exercise
Install dependencies with yarn or npm
yarn
npm install
yarn start
npm run start
yarn dev
npm run dev
To simulate an error, change the name of the returned object from {userInput: input}
to {userInput1: input}
const sendToServer = async () => {
const input = document.querySelector('#userinput').value;
userInputInHTML(input);
try {
return await fetch(`${API_URL}/secret`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
// Change below
body: JSON.stringify({ userInput: input }),
});
} catch (error) {
return { ok: false };
}
};
Client
Backend
- Github: @JRPerezJr
- LinkedIn: @devjperez
Copyright ยฉ 2021 Juan Perez Jr..
This project is MIT licensed.
This README was generated with โค๏ธ at readme.so by @katherinepeterson