Skip to content

Commit d0082b5

Browse files
committed
Load postcode database directly from GitHub raw URL
- Fetch postcodes.pcod from GitHub instead of bundling it - Remove duplicate file from playground/public/ - Update preload link to use GitHub URL - Reduces deployment size and ensures single source of truth
1 parent 3261e3f commit d0082b5

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

playground/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css"
1212
rel="stylesheet">
1313
<!-- Preload the database -->
14-
<link rel="preload" href="/postcodes.pcod" as="fetch"
14+
<link rel="preload" href="https://raw.githubusercontent.com/robertpitt/postcode-db/main/postcodes.pcod" as="fetch"
1515
type="application/octet-stream" crossorigin>
1616
</head>
1717
<body class="bg-gray-50 min-h-screen">

playground/public/postcodes.pcod

-6.21 MB
Binary file not shown.

playground/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ class PostcodeSearchApp {
114114
try {
115115
this.showLoading('Loading postcode database...')
116116

117-
// Fetch the database file
118-
const response = await fetch('/postcodes.pcod')
117+
// Fetch the database file from GitHub
118+
const response = await fetch('https://raw.githubusercontent.com/robertpitt/postcode-db/main/postcodes.pcod')
119119
if (!response.ok) {
120120
throw new Error(`Failed to load database: ${response.statusText}`)
121121
}

0 commit comments

Comments
 (0)