feat: es6+mods

This commit is contained in:
Andres 2023-10-06 22:11:40 +02:00
parent 773b64ea30
commit 19c92ed244
19 changed files with 179 additions and 245 deletions

View file

@ -1,5 +1,5 @@
const axios = require("axios");
const fs = require("fs");
import axios from "axios";
import fs from "node:fs";
const baseURL = process.env.ZU_CONTROLLER_ENDPOINT || "http://localhost:9993/";
@ -10,7 +10,7 @@ if (process.env.ZU_CONTROLLER_TOKEN) {
token = fs.readFileSync("/var/lib/zerotier-one/authtoken.secret", "utf8");
}
module.exports = axios.create({
export const api = axios.create({
baseURL: baseURL,
responseType: "json",
headers: {