Common exports
This commit is contained in:
1 parent
e94a52d00a
commit
8cfcb72f0c
3 files changed
+27
-29
No files matched your search
+2
-7
@@ -2,9 +2,8 @@ import express from "express";
|
||||
import bodyParser from "body-parser";
|
||||
import open from "open";
|
||||
import fetch from "node-fetch";
|
||||
import {readFileSync, writeFileSync} from "fs";
|
||||
import {dirname} from "path";
|
||||
import {fileURLToPath} from "url";
|
||||
import { writeFileSync } from "fs";
|
||||
import { secretsFile, secrets } from "./common.js";
|
||||
|
||||
const app = express()
|
||||
app.use(bodyParser.urlencoded({ extended: true }));
|
||||
@@ -13,10 +12,6 @@ const port = 8080;
|
||||
|
||||
let state = "code";
|
||||
|
||||
// Read and parse JSON. There is no __dirname for modules
|
||||
const secretsFile = `${dirname(fileURLToPath(import.meta.url))}/../secrets.json`;
|
||||
const secrets = JSON.parse(readFileSync(secretsFile, "utf8"));
|
||||
|
||||
// Express route that prints request body and query parameters
|
||||
app.use("/", (req, res) => {
|
||||
switch (state) {
|
||||
|
||||
Reference in new issue
Block a user