Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/ohcnetwork/care_fe into …
Browse files Browse the repository at this point in the history
…encounter-overview-location
  • Loading branch information
amjithtitus09 committed Feb 11, 2025
2 parents c6fa906 + 5a73bf2 commit 5819c06
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ REACT_APP_META_DESCRIPTION="Revolutionizing EMR with AI: Open Healthcare Network
REACT_APP_COVER_IMAGE=https://cdn.ohc.network/care_logo.svg
REACT_APP_COVER_IMAGE_ALT=https://cdn.ohc.network/care_logo.svg
REACT_PUBLIC_URL=https://care.ohc.network
HEADERS="/*\n Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\n X-XSS-Protection: 1; mode=block\n X-Frame-Options: SAMEORIGIN\n X-Content-Type-Options: nosniff\n Referrer-Policy: strict-origin-when-cross-origin\n Permissions-Policy: geolocation=(self), microphone=()"

# Care API URL without the /api prefix
REACT_CARE_API_URL=https://careapi.ohc.network
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ src/pluginMap.ts
# Federation Temp files
/.__mf__temp
public/sbom/*
public/_headers
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"supported-browsers": "node ./scripts/generate-supported-browsers.mjs",
"build": "npm run setup && npm run build:meta && npm run supported-browsers && npm run build:react",
"setup": "tsx scripts/setup-care-apps.ts",
"postinstall": "tsx scripts/install-platform-deps.ts && tsx scripts/generate-sbom-data.ts",
"postinstall": "tsx scripts/install-platform-deps.ts && tsx scripts/generate-sbom-data.ts && tsx scripts/generate-headers.ts",
"test": "snyk test",
"cypress:open": "cross-env NODE_ENV=development cypress open",
"cypress:run": "cross-env NODE_ENV=development cypress run",
Expand Down Expand Up @@ -210,4 +210,4 @@
"node": ">=22.8.0"
},
"packageManager": "npm@10.9.2"
}
}
27 changes: 27 additions & 0 deletions scripts/generate-headers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { writeFile } from "fs/promises";
import path from "path";

const headers = process.env.HEADERS;
const header_folder = path.join(__dirname, "..", "public");

async function writeHeaders() {
if (!headers) {
console.warn("HEADERS environment variable is not set.");
process.exit(0);
}

console.log("HEADERS environment variable is set.");
const headersPath = path.join(header_folder, "_headers");
console.log(`Writing headers to file at path: ${headersPath}`);

try {
await writeFile(headersPath, headers, "utf-8");
console.log("Headers written to file successfully.");
process.exit(0);
} catch (error) {
console.error("Error writing headers to file:", error);
process.exit(0);
}
}

writeHeaders();

0 comments on commit 5819c06

Please sign in to comment.