Load API_BASE_URL from backend
- Remove api_base_url constant
This commit is contained in:
parent
bb23afc000
commit
e4537e250d
|
@ -0,0 +1,4 @@
|
||||||
|
export default function handler(req, res) {
|
||||||
|
// Return the API_BASE_URL. This Endpoint allows us to access the env Variable in client javascript
|
||||||
|
res.status(200).json({ apiBaseUrl: process.env.API_BASE_URL })
|
||||||
|
}
|
|
@ -1,5 +1,3 @@
|
||||||
exports.API_BASE_URL = 'https://api.covidpass.marvinsextro.de/'
|
|
||||||
|
|
||||||
exports.VALUE_SET_BASE_URL = 'https://raw.githubusercontent.com/ehn-dcc-development/ehn-dcc-valuesets/main/'
|
exports.VALUE_SET_BASE_URL = 'https://raw.githubusercontent.com/ehn-dcc-development/ehn-dcc-valuesets/main/'
|
||||||
exports.VALUE_TYPES = {
|
exports.VALUE_TYPES = {
|
||||||
medicalProducts: 'vaccine-medicinal-product.json',
|
medicalProducts: 'vaccine-medicinal-product.json',
|
||||||
|
|
|
@ -45,7 +45,11 @@ exports.createPass = async function(data) {
|
||||||
);
|
);
|
||||||
zip.push({ path: 'manifest.json', data: manifestJson });
|
zip.push({ path: 'manifest.json', data: manifestJson });
|
||||||
|
|
||||||
const response = await fetch(`${constants.API_BASE_URL}/sign`, {
|
// Load API_BASE_URL form nextjs backend
|
||||||
|
const configResponse = await fetch('/api/config')
|
||||||
|
const apiBaseUrl = (await configResponse.json()).apiBaseUrl
|
||||||
|
|
||||||
|
const response = await fetch(`${apiBaseUrl}/sign`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/octet-stream',
|
'Accept': 'application/octet-stream',
|
||||||
|
|
Loading…
Reference in New Issue