Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mrice32 authored Jan 15, 2025
1 parent ec70f38 commit b253998
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/available-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { object, Infer, optional, string } from "superstruct";
import dotenv from "dotenv";
import { validAddress, positiveIntStr } from "./_utils";
import { TypedVercelRequest } from "./_types";
import fs from "fs";
import path from "path";

const AvailableRoutesQueryParamsSchema = object({
originToken: optional(validAddress()),
Expand All @@ -17,11 +19,18 @@ dotenv.config({
path: "./output_api.env",
});


let envPath = path.join(process.cwd(), 'output_api.env');
let envFile = fs.readFileSync(envPath);

type AvailableRoutesQueryParams = Infer<
typeof AvailableRoutesQueryParamsSchema
>;

const handler = async (_: any, response: VercelResponse) => {
if (envFile === "") {
response.status(500).json({ error: "ERROR NO ENV FOUND" });
}
response.status(200).json({
test: process.env.GIT_ENV_EXPORTED,
});
Expand Down

0 comments on commit b253998

Please sign in to comment.