Skip to content

Commit

Permalink
Add GENEZIO_TOKEN to deploy for the user trying the app
Browse files Browse the repository at this point in the history
Signed-off-by: Andreia Ocanoaia <andreia.ocanoaia@gmail.com>
  • Loading branch information
andreia-oca committed Aug 14, 2023
1 parent a37f7a2 commit a8ebb07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core-deployment/src/routes/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ const router = express.Router();
const exec = Exec.default;

router.post("/", async (req, res) => {
const { classInfo, functionsList } = req.body;
const { classInfo, functionsList, genezioToken } = req.body;

if (!classInfo || !functionsList ) {
return res.status(400).json({
message: "Missing required parameters",
});
}

if (!genezioToken) {
console.log("Warning: no genezio token provided. We will use the default token for this demo.");
}

const folderName = `genezio-${Math.random().toString(36).substring(7)}`;
const folderPath = path.join(os.tmpdir(), folderName);
if (!fs.existsSync(folderPath)) {
Expand Down Expand Up @@ -78,7 +82,7 @@ router.post("/", async (req, res) => {
});


const output = await exec(`genezio deploy --install-deps`, {
const output = await exec(`GENEZIO_TOKEN=${genezioToken} genezio deploy --install-deps`, {
cwd: folderPath,
log: false
}).catch((err: any) => {
Expand Down

0 comments on commit a8ebb07

Please sign in to comment.