No description
Find a file
2026-02-26 14:37:05 +01:00
api_v1 first commit 2026-02-26 11:48:04 +01:00
public 5th 2026-02-26 14:07:22 +01:00
.env first commit 2026-02-26 11:48:04 +01:00
.gitignore first commit 2026-02-26 11:48:04 +01:00
package-lock.json first commit 2026-02-26 11:48:04 +01:00
package.json 6th 2026-02-26 14:37:05 +01:00
README.md first commit 2026-02-26 11:48:04 +01:00

Galleria con json-server e protetto con JWT

Installazione

clonare questa repo e installare tutte le dipendenze con npm ci

Start/Stop servers

Description Script
Start server senza auth npm start-no-auth
Start server con auth npm run start

Tools

Description Script
Generate user hashed passwords npm run hash

json-server api reference

Come usarlo

clonare e poi installare con

npm ci

nel file .env ci sono tutti i dati da modificare

poi inserire in user.json user e password utilizzati per fare il login

la password da inserire è criptata e viene generata con npm run hash

il nome viene utilizzato come cartella da scansionare, si trova dentro photos

es:

name: Fabio

public/photos
└── Fabio
    └── original
        └── 2017Irlanda19-29ago
            ├── IMG_0092.JPG
            ├── IMG_0099.JPG
            ├── IMG_0100.JPG

poi dentro Fabio genererà thumbs con tutti i thumbs

  • npm run start
  • su IP:4000 ci sarà la galleria e andando su impostazioni si potrà fare lo scan di tutte le foto

dopo aver fatto lo scan è possibile richiedere il json al server con tutte le informazioni anche senza autorizzazione

basta farlo partire con npm run start-no-auth e le info si possono vedere con

ip:4000/photos

  • npm start

Inspired in this post by Techiediaries