improving package.json with api endpoint info dev/prod

This commit is contained in:
msramalho
2023-02-27 12:01:01 +01:00
parent 6bd4c1d428
commit 37d856504d
2 changed files with 5 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"build": "rm -rf distribution && rm -f distribution.zip && parcel build source/manifest.json --no-content-hash --no-source-maps --dist-dir distribution --no-cache --detailed-report 0 && zip -r distribution.zip distribution",
"build": "rm -rf distribution && rm -f distribution.zip && API_ENDPOINT=http://134.122.58.133:8004/tasks parcel build source/manifest.json --no-content-hash --no-source-maps --dist-dir distribution --no-cache --detailed-report 0 && zip -r distribution.zip distribution",
"lint": "run-p lint:*",
"lint-fix": "run-p 'lint:* -- --fix'",
"lint:css": "stylelint source/**/*.css",

View File

@@ -3,9 +3,10 @@
import optionsStorage from './options-storage.js';
import { getReasonPhrase } from 'http-status-codes';
// TODO: stable ID https://developer.chrome.com/docs/extensions/mv3/tut_oauth/
// const API_ENDPOINT = 'http://localhost:8004/tasks'
const API_ENDPOINT = 'http://134.122.58.133:8004/tasks';
// const API_ENDPOINT = process.env.API_ENDPOINT || 'http://134.122.58.133:8004/tasks';
const API_ENDPOINT = process.env.API_ENDPOINT || 'http://localhost:8004/tasks';
console.log(`using API_ENDPOINT=${API_ENDPOINT}`)
const LOGIN_FAILED = `Could not login, make sure your google account email has been granted access by the developers.`;