mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 19:28:09 +00:00
Update node.mdx
This commit is contained in:
@@ -65,7 +65,7 @@ const setupClient = () => {
|
|||||||
siteUrl: "your-infisical-instance.com" // Optional, defaults to https://app.infisical.com
|
siteUrl: "your-infisical-instance.com" // Optional, defaults to https://app.infisical.com
|
||||||
});
|
});
|
||||||
|
|
||||||
await client.auth().universalAuth.login({
|
await infisicalSdk.auth().universalAuth.login({
|
||||||
clientId: "<machine-identity-client-id>",
|
clientId: "<machine-identity-client-id>",
|
||||||
clientSecret: "<machine-identity-client-secret>"
|
clientSecret: "<machine-identity-client-secret>"
|
||||||
});
|
});
|
||||||
@@ -77,12 +77,12 @@ const setupClient = () => {
|
|||||||
|
|
||||||
|
|
||||||
app.get("/", async (req, res) => {
|
app.get("/", async (req, res) => {
|
||||||
await setupClient();
|
|
||||||
|
|
||||||
const name = await client.getSecret({
|
|
||||||
|
const name = await client.secrets().getSecret({
|
||||||
environment: "dev", // dev, staging, prod, etc.
|
environment: "dev", // dev, staging, prod, etc.
|
||||||
projectId: "<project-id>",
|
projectId: "<project-id>",
|
||||||
path: "/",
|
secretPath: "/",
|
||||||
secretName: "NAME"
|
secretName: "NAME"
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -90,7 +90,8 @@ app.get("/", async (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.listen(PORT, async () => {
|
app.listen(PORT, async () => {
|
||||||
// initialize http server
|
// initialize http server and Infisical
|
||||||
|
await setupClient();
|
||||||
console.log(`Server listening on port ${PORT}`);
|
console.log(`Server listening on port ${PORT}`);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user