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