Skip to main content

Welcome to Cat Data API

A lightweight, secure REST API built with Express.js and PostgreSQL for managing cat-related catalog data. Features Auth0 JWT authentication and image upload capabilities.

Quickstart

Get up and running with the Cat Data API in minutes

Authentication

Learn how to authenticate with Auth0 JWT tokens

API Reference

Explore all available endpoints and parameters

Database Schema

Understand the PostgreSQL database structure

Key Features

Auth0 Authentication

Secure JWT-based authentication using Auth0 with JWKS validation

Image Uploads

Upload and manage JPEG/PNG images with multer file handling

PostgreSQL Database

Robust data storage with Knex.js query builder and migrations

CORS Enabled

Ready for frontend integration with configurable CORS support

API Endpoints

The Cat Data API provides RESTful endpoints for image management:
  • POST /api/upload - Upload new images
  • GET /api/images - List all images
  • GET /api/image/:id - Retrieve a specific image
  • DELETE /api/image/:id - Delete an image
All endpoints require Auth0 JWT authentication.

Quick Example

Example Request
curl -X POST http://localhost:3000/api/upload \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -F "file=@cat-photo.jpg"
Example Response
{
  "id": 1,
  "filename": "550e8400-e29b-41d4-a716-446655440000-cat-photo.jpg"
}