mm-math 0.0.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.html +2 -1
  2. package/package.json +2 -2
package/index.html CHANGED
@@ -519,6 +519,7 @@ document.getElementById('fUser').addEventListener('keydown', e => {
519
519
  });
520
520
 
521
521
  // ── Login ─────────────────────────────────────────────────────────────────────
522
+ const API_BASE = window.location.hostname === 'calc.moshelab.com' ? '' : 'https://calc.moshelab.com';
522
523
  async function doLogin() {
523
524
  const username = document.getElementById('fUser').value.trim();
524
525
  const password = document.getElementById('fPass').value;
@@ -535,7 +536,7 @@ async function doLogin() {
535
536
  errEl.textContent = '';
536
537
 
537
538
  try {
538
- const res = await fetch('/api/login', {
539
+ const res = await fetch(API_BASE + '/api/login', {
539
540
  method: 'POST',
540
541
  headers: { 'Content-Type': 'application/json' },
541
542
  body: JSON.stringify({ username, password }),
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "mm-math",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
4
  "description": "STEM educational toolkit",
5
- "main": "api.js",
5
+ "main": "index.html",
6
6
  "files": [
7
7
  "api.js",
8
8
  "index.html",