remove baseurl.txt
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -33,7 +33,6 @@ next-cart-app.zip
|
|||||||
!public/uploads/thumb/
|
!public/uploads/thumb/
|
||||||
certificates
|
certificates
|
||||||
content/output/*
|
content/output/*
|
||||||
baseUrl.txt
|
|
||||||
public/content/output/*
|
public/content/output/*
|
||||||
public/content/output/shifts 2024.1.json
|
public/content/output/shifts 2024.1.json
|
||||||
!public/content/uploads/*
|
!public/content/uploads/*
|
@ -56,17 +56,6 @@ exports.isValidPhoneNumber = function (phone) {
|
|||||||
// If neither condition is met, the phone number is invalid
|
// If neither condition is met, the phone number is invalid
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
exports.setBaseUrl = function (req) {
|
|
||||||
const protocol = req.headers['x-forwarded-proto'] || 'http';
|
|
||||||
const host = req.headers.host;
|
|
||||||
const baseUrl = `${protocol}://${host}`;
|
|
||||||
|
|
||||||
// Write the baseUrl to the file
|
|
||||||
if (req != null) {
|
|
||||||
fs.writeFileSync(path.join(__dirname, 'baseUrl.txt'), baseUrl, 'utf8');
|
|
||||||
}
|
|
||||||
return baseUrl;
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.getBaseUrl = function (relative = "", req = null) {
|
exports.getBaseUrl = function (relative = "", req = null) {
|
||||||
return process.env.NEXT_PUBLIC_PUBLIC_URL + relative;
|
return process.env.NEXT_PUBLIC_PUBLIC_URL + relative;
|
||||||
|
Reference in New Issue
Block a user