Skip to content

geminixandroid/local-pcrs-dev-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local PCRS Server 🚀

Simple Express server for testing PCRS (Pharmacy Claims Reimbursement System) integrations.

📦 Quick Start

# Install dependencies
npm install

# Start the server
npm start

Server will run on: http://localhost:3001

📡 API Endpoints

🔍 GET - Download Files

GET /portal/pharmacy-3rd-gen/sec/p2p/download/exception?filename=example.xml
  • Downloads files from the public/ folder
  • Supports: .xml, .zip files
  • Returns proper Content-Type headers

⬆️ POST - Upload Files

POST /portal/pharmacy-3rd-gen/sec/p2p/3.4/upload/file
  • File upload endpoint (max 100MB)
  • Field name: pharmacyFile
  • Files saved to uploads/ folder with original names
  • Returns XML response (currently always returns error response)

🔧 OPTIONS - Preflight

OPTIONS *
  • Handles CORS preflight requests
  • Returns HTTP 200

🛠️ Features

  • ✅ CORS enabled for cross-domain requests
  • ✅ File uploads with multer (100MB limit)
  • ✅ File downloads from public folder
  • ✅ Proper Content-Type headers (XML/ZIP)
  • ✅ No-cache headers for fresh responses
  • ✅ Auto-creates public/ and uploads/ folders
  • ✅ Simple and lightweight

📁 Project Structure

├── server.js          # Main server file 🎯
├── package.json       # Dependencies & scripts 📋
├── public/            # Downloadable files folder 📂
├── uploads/           # Uploaded files folder 📤
└── README.md          # This file 📖

🚀 Usage Examples

Download Files

# Download XML file
curl "http://localhost:3001/portal/pharmacy-3rd-gen/sec/p2p/download/exception?filename=test.xml"

# Download ZIP file
curl "http://localhost:3001/portal/pharmacy-3rd-gen/sec/p2p/download/exception?filename=data.zip"

Upload Files

# Upload file using curl
curl -X POST http://localhost:3001/portal/pharmacy-3rd-gen/sec/p2p/3.4/upload/file \
  -F

About

Local pcrs dev server

Topics

Resources

License

Stars

Watchers

Forks