2023-03-17 & 2023-03-22 workshop tasks
This is simple admin page made with node express server.
Login, logout with express-session.
Add more admin users, edit, delete users.
Database - json file;
Validation: do not allow duplicate emails;
🎯 Goals:
Create login page with a form of two fields: email and password.
Pass form data to separate route using POST method. Check if login data match email: admin@admin.lt(original was admin@bit.lt) and password: 1234
If login details did not mach redirect user back to login page.
If login successful - redirect user to new route '/admin';
Add functionality to add new users on admin page by entering their name, surname, email and password.
Save data in JSON database.
New created users must be able to login as admin;
On original task code for deleting users was already given
Do not allow admin to delete his own account.
Add functionality to edit users, do not allow duplicate emails.
Must have Node.js installed
-
Clone the repo
-
Go into project directory and Install NPM packages
npm install
-
use application:
npm start
-
default login: admin@admin.lt, 1234