Skip to content

login to admin page and add users. Learning node express routing

Notifications You must be signed in to change notification settings

codevivi/admin-login-add-users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🪧 Express admin

2023-03-17 & 2023-03-22 workshop tasks

📋 About

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:

link to task (lt)

Task 1

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';

Task 2

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;

Task 3

On original task code for deleting users was already given

Do not allow admin to delete his own account.

Task 4

Add functionality to edit users, do not allow duplicate emails.

🏁 Getting started

Must have Node.js installed

  1. Clone the repo

  2. Go into project directory and Install NPM packages

    npm install
  3. use application:

    npm start
  4. default login: admin@admin.lt, 1234

gif app screenshot