mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-06 04:51:44 -07:00
refactor: squash commits
This commit is contained in:
parent
63ebcb5915
commit
1e6e237aa3
107 changed files with 20077 additions and 0 deletions
19
backend/utils/controller-api.js
Normal file
19
backend/utils/controller-api.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
const axios = require("axios");
|
||||
const fs = require("fs");
|
||||
|
||||
const baseURL = process.env.ZU_CONTROLLER_ENDPOINT || "http://localhost:9993/";
|
||||
|
||||
var token;
|
||||
if (process.env.ZU_CONTROLLER_TOKEN) {
|
||||
token = process.env.ZU_CONTROLLER_TOKEN;
|
||||
} else {
|
||||
token = fs.readFileSync("/var/lib/zerotier-one/authtoken.secret", "utf8");
|
||||
}
|
||||
|
||||
module.exports = axios.create({
|
||||
baseURL: baseURL,
|
||||
responseType: "json",
|
||||
headers: {
|
||||
"X-ZT1-Auth": token,
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue