Basic oAuth for QBO BOD-266

This commit is contained in:
Patrick Fic
2020-08-25 10:28:24 -07:00
parent dabc8892b9
commit 5e4a825bcf
10 changed files with 517 additions and 111 deletions

View File

@@ -125,6 +125,10 @@ app.post("/tech/login", fb.validateFirebaseIdToken, tech.techLogin);
var utils = require("./server/utils/utils");
app.post("/utils/time", utils.servertime);
var qbo = require("./server/accounting/qbo/qbo");
app.post("/qbo/authorize", qbo.authorize);
app.get("/qbo/callback", qbo.callback);
//Serve React App if in Production
if (process.env.NODE_ENV === "production") {
app.use(express.static(path.join(__dirname, "client/build")));
@@ -149,19 +153,23 @@ if (process.env.NODE_ENV === "production") {
console.log("[PRODUCTION] Server running on port " + port);
});
} else {
https
.createServer(
{
key: fs.readFileSync("./key.pem"),
cert: fs.readFileSync("./cert.pem"),
passphrase: "Wl0d8k@!",
},
app
)
.listen(port, (error) => {
if (error) throw error;
console.log("[DEV/STAGING] Mock HTTPS Server running on port " + port);
});
app.listen(port, (error) => {
if (error) throw error;
console.log("[DEVELOPMENT] Non Secured Server running on port " + port);
});
// https
// .createServer(
// {
// key: fs.readFileSync("./key.pem"),
// cert: fs.readFileSync("./cert.pem"),
// passphrase: "Wl0d8k@!",
// },
// app
// )
// .listen(port, (error) => {
// if (error) throw error;
// console.log("[DEV/STAGING] Mock HTTPS Server running on port " + port);
// });
}
// app.listen(port, error => {