mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 18:44:17 +00:00
fix globals
This commit is contained in:
parent
2b6d7eec40
commit
97497dc642
@ -3,17 +3,18 @@
|
|||||||
"version": "0.10.0",
|
"version": "0.10.0",
|
||||||
"description": "A simple, fast, and powerful REST API interface library",
|
"description": "A simple, fast, and powerful REST API interface library",
|
||||||
"author": "RageStudio",
|
"author": "RageStudio",
|
||||||
"main": "dist/index.js",
|
"main": "./dist/client/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "corenode-node ./src/bin/server.js",
|
"start": "corenode-node ./src/bin/server.js",
|
||||||
"build": "corenode-cli build --parallel --clean --fix && chmod -R 777 ./dist",
|
"build": "corenode-cli build --parallel --clean && chmod -R 777 ./dist",
|
||||||
"test": "mocha"
|
"test": "mocha"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"**/**"
|
"dist/**/**",
|
||||||
|
"./package.json"
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
const fs = require("fs")
|
|
||||||
const path = require("path")
|
const path = require("path")
|
||||||
const packageJSON = require(path.resolve(process.cwd(), "package.json"))
|
const fs = require("fs")
|
||||||
|
|
||||||
const http = require("nanoexpress")
|
const http = require("nanoexpress")
|
||||||
const net = require("corenode/net")
|
const net = require("corenode/net")
|
||||||
|
|
||||||
|
const packageJSON = require(path.resolve(module.path, "../../package.json"))
|
||||||
|
global.LINEBRIDGE_SERVER_VERSION = packageJSON.version
|
||||||
|
|
||||||
const tokenizer = require("corenode/libs/tokenizer")
|
const tokenizer = require("corenode/libs/tokenizer")
|
||||||
const { randomWord } = require("@corenode/utils")
|
const { randomWord } = require("@corenode/utils")
|
||||||
|
|
||||||
const { serverManifest } = require("../lib")
|
const { serverManifest } = require("../lib")
|
||||||
|
|
||||||
const SERVER_VERSION = global.SERVER_VERSION = packageJSON.version
|
global.LOCALHOST_ADDRESS = net.ip.getHostAddress() ?? "localhost"
|
||||||
const LOCALHOST_ADDRESS = global.LOCALHOST_ADDRESS = net.ip.getHostAddress() ?? "localhost"
|
global.VALID_HTTP_METHODS = ["get", "post", "put", "patch", "del", "trace", "head", "any", "options", "ws"]
|
||||||
const VALID_HTTP_METHODS = global.VALID_HTTP_METHODS = ["get", "post", "put", "patch", "del", "trace", "head", "any", "options", "ws"]
|
global.DEFAULT_HEADERS = {
|
||||||
const DEFAULT_HEADERS = global.DEFAULT_HEADERS = {
|
|
||||||
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept, Authorization",
|
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept, Authorization",
|
||||||
"Access-Control-Allow-Origin": "*",
|
"Access-Control-Allow-Origin": "*",
|
||||||
"Access-Control-Allow-Methods": "GET, POST, OPTIONS, PUT, PATCH, DELETE, DEL",
|
"Access-Control-Allow-Methods": "GET, POST, OPTIONS, PUT, PATCH, DELETE, DEL",
|
||||||
@ -191,11 +191,11 @@ class Server {
|
|||||||
route: "/",
|
route: "/",
|
||||||
fn: (req, res) => {
|
fn: (req, res) => {
|
||||||
return res.json({
|
return res.json({
|
||||||
|
LINEBRIDGE_SERVER_VERSION: LINEBRIDGE_SERVER_VERSION,
|
||||||
id: this.id,
|
id: this.id,
|
||||||
usid: this.usid,
|
usid: this.usid,
|
||||||
oskid: this.oskid,
|
oskid: this.oskid,
|
||||||
time: new Date().getTime(),
|
requestTime: new Date().getTime(),
|
||||||
version: SERVER_VERSION,
|
|
||||||
endpointsMap: this.endpointsMap,
|
endpointsMap: this.endpointsMap,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user