- Node.js v20.11.1
- npm v10.5.0
- Windows 10
-
Clone the repository
git clone https://github.com/helloworld0606/interviewProjects.git
-
Run the backend server
cd interviewProjects/backend npm install npm audit # find security vulnerabilities npm audit fix # fix any security vulnerabilities node server.js
-
Run the frontend server (open another cmd)
cd interviewProjects/frontend npm install npm audit # find security vulnerabilities npm audit fix # fix any security vulnerabilities npm run serve
-
The app will run at http://localhost:8080/
(make sure backend is running)
Get account
curl -X GET http://localhost:3000/users
Add account
curl -X POST "http://localhost:3000/users" -H "Content-Type: application/json" -d "{\"id\": 2, \"name\": \"James\", \"account\": \"[email protected]\", \"password\": \"DEF789\"}"
Login account
curl -X POST "http://localhost:3000/users/login" -H "Content-Type: application/json" -d "{\"account\": \"[email protected]\", \"password\": \"DEF789\"}"
Account: [email protected]
Password: ABC123456
- The login info will be saved in session storage
- To try a new login, open the inspect window —> go to Application —> SessionStorage —> clear all login records —> refresh the website