/express-auth-demo

A login demo with Express.js and Vue.js.

Primary LanguageJavaScriptMIT LicenseMIT

express-auth-demo

About

An authentication demo with Express.js and Vue.js. The following technologies were used in the project, you can find them in the code.

  1. Session based authentication.
  2. HTML5 history mode.
  3. CORS with cookie.
  4. HTTPS with self-signed certificate.

Dependence

Node.js

export N_NODE_MIRROR="https://mirrors.ustc.edu.cn/node/"
export N_NODE_DOWNLOAD_MIRROR="https://mirrors.ustc.edu.cn/node/"
curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n | sudo -E bash -s lts

podman

  1. podman (and start as a service).
  2. podman-compose.

Usage

Start Server

git clone https://github.com/Arondight/express-auth-demo.git
cd ./express-auth-demo/
sudo podman-compose -f ./podman-compose/mongodb.yml up -d
npm install
npm run build
npm start

Trust Self-signed Certificate

Run the command below and trust the certificate in browser.

xdg-open https://localhost:3000/hello
xdg-open https://localhost:8000/hello

In Firefox click the Advanced... then the Accept the Risk and Continue. In Chrome click Adavanced then click Proceed to localhost (unsafe).

Visit Home Page

xdg-open https://localhost:8000

LICENSE

MIT License.