-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #790 from CodeForAfrica/fix/vpnmanager-build-failing
@vpnmanager script not running
- Loading branch information
Showing
9 changed files
with
174 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
async function main() { | ||
const NEXT_PUBLIC_APP_URL = process.env.NEXT_PUBLIC_APP_URL; | ||
const API_SECRET_KEY = process.env.API_SECRET_KEY; | ||
const headers = { | ||
"x-api-key": API_SECRET_KEY ?? "", | ||
}; | ||
const res = await fetch(`${NEXT_PUBLIC_APP_URL}/api/processGsheet`, { | ||
headers, | ||
}); | ||
return res.json(); | ||
} | ||
|
||
const responseJson = await main(); | ||
console.log(responseJson); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { NextApiResponse, NextApiRequest } from "next"; | ||
import { processNewUsers } from "@/vpnmanager/lib/processUsers"; | ||
|
||
export async function handler(req: NextApiRequest, res: NextApiResponse) { | ||
try { | ||
const key: string = req.headers["x-api-key"] as string; | ||
const API_SECRET_KEY = process.env.API_SECRET_KEY; | ||
if (!(key && key !== API_SECRET_KEY)) { | ||
return res.status(403).json({ message: "INVALID_API_KEY" }); | ||
} | ||
processNewUsers(); | ||
return res.status(200).json({ message: "Process Started" }); | ||
} catch (error) {} | ||
} | ||
export default handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.