1
0
Fork
You've already forked WebBarcodeScan
0
testing web barcode scanning using svelte
  • Svelte 91.6%
  • JavaScript 4.2%
  • TypeScript 2.4%
  • HTML 1.8%
2026年01月03日 16:56:02 +01:00
WebBarcodeScan both scanner on one scan page 2026年01月03日 16:56:02 +01:00
.gitignore HTTPS certificate 2025年11月08日 15:44:03 +01:00
README.md Update README.md 2025年11月08日 16:06:07 +01:00

WebBarcodeScan

testing web barcode scanning using svelte

Running

npm run dev -- --host --open

--host hosts the project accessible from mobile devices

Note

May requies to disable firewall

sudo ufw disable

Running HTTPS

Note

Neded for camera access on mobile browsers

Generate self-signed certificates

mkcert localhost

This will create files named something like:

 localhost.pem (certificate)
 localhost-key.pem (private key)

Edit your Vite config (vite.config.js or vite.config.ts)

Add HTTPS config:

import { sveltekit } from '@sveltejs/kit/vite';
import fs from 'fs';
export default {
 plugins: [sveltekit()],
 server: {
 https: {
 key: fs.readFileSync('./localhost-key.pem'),
 cert: fs.readFileSync('./localhost.pem'),
 }
 }
};
``