axiodb
Version:
A blazing-fast, lightweight, and scalable nodejs package based DBMS for modern application. Supports schemas, encryption, and advanced query capabilities.
73 lines • 2.44 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AvailableRoutes = exports.staticPath = exports.CORS_CONFIG = exports.ServerKeys = void 0;
const path_1 = __importDefault(require("path"));
var ServerKeys;
(function (ServerKeys) {
ServerKeys[ServerKeys["PORT"] = 27018] = "PORT";
ServerKeys["LOCALHOST"] = "127.0.1";
ServerKeys["DEFAULT_KEY_EXPIRE"] = "1h";
ServerKeys["DEFAULT_KEY_ISSUER"] = "AxioDB Server";
ServerKeys["DEFAULT_KEY_AUDIENCE"] = "AxioDB Client";
ServerKeys["DEFAULT_KEY_REASON"] = "For Transacting with AxioDB Server";
ServerKeys[ServerKeys["DEFAULT_KEY_TIMESTAMP"] = Date.now()] = "DEFAULT_KEY_TIMESTAMP";
ServerKeys[ServerKeys["DEFAULT_KEY_ROUNDS"] = 1] = "DEFAULT_KEY_ROUNDS";
})(ServerKeys || (exports.ServerKeys = ServerKeys = {}));
// Config for CORS
exports.CORS_CONFIG = {
ORIGIN: "*",
METHODS: ["GET", "HEAD", "PUT", "PATCH", "POST", "DELETE"],
ALLOWED_HEADERS: ["Content-Type", "Authorization"],
EXPOSED_HEADERS: ["Content-Length", "X-Requested-With"],
MAX_AGE: 86400, // 24 hours in seconds
ALLOW_CREDENTIALS: true,
};
exports.staticPath = path_1.default.resolve(__dirname, "../public/AxioControl");
// Routes
exports.AvailableRoutes = [
{
method: "GET",
path: "/api/info",
description: "To Get Internal Informations about this DB",
},
{
method: "GET",
path: "/api/health",
description: "Health check endpoint to verify server status",
},
{
method: "GET",
path: "/api/routes",
description: "List all available API routes",
},
{
method: "GET",
path: "/api/get-token",
description: "Get a new token for transacting with AxioDB Server",
},
{
method: "GET",
path: "/api/db/databases",
description: "Get a list of all databases",
},
{
method: "POST",
path: "/api/db/create-database",
description: "Create a new database",
payload: {
name: "string",
},
},
{
method: "DELETE",
path: "/api/db/delete-database",
description: "Delete a database",
payload: {
name: "string",
},
},
];
//# sourceMappingURL=keys.js.map