UNPKG

5.39 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var __metadata = (this && this.__metadata) || function (k, v) {
9 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10};
11var __importDefault = (this && this.__importDefault) || function (mod) {
12 return (mod && mod.__esModule) ? mod : { "default": mod };
13};
14Object.defineProperty(exports, "__esModule", { value: true });
15const is_lambda_1 = __importDefault(require("is-lambda"));
16const Config_1 = require("./Services/Config");
17class APIConfig {
18}
19// If running as a server, this is the port that will be used.
20APIConfig.WEB_PORT = 3000;
21// The root URL for this API, this must be changed when it gets pushed to your production API
22APIConfig.API_URL_BASE = `http://localhost${APIConfig.WEB_PORT === 80 ? "" : `:${APIConfig.WEB_PORT}`}`;
23// If set to true, APIs will only be loaded when they are accessed. This can cut down on memory used in a lambda function.
24APIConfig.LAZY_LOAD_APIS = true;
25// Used to force the API to run as a server, otherwise it will run as a lambda function when deployed serverlessly.
26APIConfig.RUN_AS_SERVER = !is_lambda_1.default;
27// If set to true, raw error messages will be included in errors output from the API. This can be useful for debugging, but should usually be turned off in production.
28APIConfig.DISPLAY_RAW_ERRORS = false;
29// If set to true, this will log all 400 status errors to console.error.
30APIConfig.LOG_400_ERRORS = false;
31// If set to true, this will log all 500 status errors to console.error.
32APIConfig.LOG_500_ERRORS = true;
33// Slightly more developer (i.e. mostly human) friendly API results. See https://github.com/jheising/HAPI
34APIConfig.OUTPUT_HAPI_RESULTS = true;
35APIConfig.AWS_REGION = "us-east-1";
36// TODO: CHANGE THIS BY SETTING AN ENVIRONMENT VARIABLE NAMED ENCRYPTION_SECRET
37APIConfig.ENCRYPTION_SECRET = "E1E8A96B838495F8CD1310304361C741";
38// This is the key-value storage service provider to use with your API (if you need it)
39APIConfig.KV_STORAGE_SERVICE_PROVIDER = "DiskKVService";
40// The storage path to be used when using the DiskKVService
41APIConfig.DISK_KV_STORAGE_ROOT_PATH = "./data/kv";
42// If set to true this will encrypt data stored in the Key-Value Service
43APIConfig.ENCRYPT_KV_DATA = true;
44// This is the file storage service provider to use with your API (if you need it)
45APIConfig.FILE_STORAGE_SERVICE_PROVIDER = "DiskFileService";
46APIConfig.DISK_FILE_SERVICE_ROOT_PATH = "./data";
47// TODO: CHANGE THIS BY SETTING AN ENVIRONMENT VARIABLE NAMED JWT_SECRET
48APIConfig.JWT_SECRET = "65e068de-81ef-457d-b00a-82364c360226";
49__decorate([
50 Config_1.EnvVarSync,
51 __metadata("design:type", Number)
52], APIConfig, "WEB_PORT", void 0);
53__decorate([
54 Config_1.EnvVarSync,
55 __metadata("design:type", String)
56], APIConfig, "API_URL_BASE", void 0);
57__decorate([
58 Config_1.EnvVarSync,
59 __metadata("design:type", Boolean)
60], APIConfig, "LAZY_LOAD_APIS", void 0);
61__decorate([
62 Config_1.EnvVarSync,
63 __metadata("design:type", Boolean)
64], APIConfig, "RUN_AS_SERVER", void 0);
65__decorate([
66 Config_1.EnvVarSync,
67 __metadata("design:type", Boolean)
68], APIConfig, "DISPLAY_RAW_ERRORS", void 0);
69__decorate([
70 Config_1.EnvVarSync,
71 __metadata("design:type", Boolean)
72], APIConfig, "LOG_400_ERRORS", void 0);
73__decorate([
74 Config_1.EnvVarSync,
75 __metadata("design:type", Boolean)
76], APIConfig, "LOG_500_ERRORS", void 0);
77__decorate([
78 Config_1.EnvVarSync,
79 __metadata("design:type", Boolean)
80], APIConfig, "OUTPUT_HAPI_RESULTS", void 0);
81__decorate([
82 Config_1.EnvVarSync,
83 __metadata("design:type", String)
84], APIConfig, "AWS_REGION", void 0);
85__decorate([
86 Config_1.EnvVarSync,
87 __metadata("design:type", String)
88], APIConfig, "ENCRYPTION_SECRET", void 0);
89__decorate([
90 Config_1.EnvVarSync,
91 __metadata("design:type", String)
92], APIConfig, "KV_STORAGE_SERVICE_PROVIDER", void 0);
93__decorate([
94 Config_1.EnvVarSync,
95 __metadata("design:type", String)
96], APIConfig, "DISK_KV_STORAGE_ROOT_PATH", void 0);
97__decorate([
98 Config_1.EnvVarSync,
99 __metadata("design:type", Boolean)
100], APIConfig, "ENCRYPT_KV_DATA", void 0);
101__decorate([
102 Config_1.EnvVarSync,
103 __metadata("design:type", String)
104], APIConfig, "DYNAMO_KV_STORAGE_TABLE_NAME", void 0);
105__decorate([
106 Config_1.EnvVarSync,
107 __metadata("design:type", String)
108], APIConfig, "FILE_STORAGE_SERVICE_PROVIDER", void 0);
109__decorate([
110 Config_1.EnvVarSync,
111 __metadata("design:type", String)
112], APIConfig, "DISK_FILE_SERVICE_ROOT_PATH", void 0);
113__decorate([
114 Config_1.EnvVarSync,
115 __metadata("design:type", String)
116], APIConfig, "S3_FILE_SERVICE_BUCKET_NAME", void 0);
117__decorate([
118 Config_1.EnvVarSync,
119 __metadata("design:type", String)
120], APIConfig, "JWT_SECRET", void 0);
121exports.APIConfig = APIConfig;
122//# sourceMappingURL=APIConfig.js.map
\No newline at end of file