Build a simple REST API for a color dataset with authentication & Redis sessions. Provide CRUD endpoints backed by a local JSON data file. Secure write operations with user login and server-side Redis sessions.
- Server: Node.js + Express (ES modules)
- Cloud hosting & Redis database: Railway
- Data: persisted to
project/data.json - Auth: Auth0 via Passport; sessions via
express-sessionwith Redis (falls back to in-memory if noREDIS_URL) - Base route
/returns a text list of available endpoints
- Navigate to https://kaggle-colors-api-production.up.railway.app/.
- That's it! Now you can test the app by navigating to available endpoints listed below.
- GET
/auth/auth0– start login - GET
/auth/auth0/callback– login callback - GET
/auth/logout– Auth0 logout + redirect - GET
/auth/success– indicates successfull login & logged-in user info - GET
/auth/failure– indicates login failure - GET
/me– current user (session) - POST
/logout– clear local Redis session
- GET
/colors– list colors - GET
/colors/:name– get color by name - POST
/colors– add color (auth) - PUT
/colors/:name– update color (auth) - DELETE
/colors/:name– delete color (auth)
