@3sixty/api-service 0.0.0-stage → 0.20.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/healthApplicationTask.js +151 -0
- package/dist/es/healthApplicationTask.js.map +1 -0
- package/dist/es/healthRoutes.js +125 -0
- package/dist/es/healthRoutes.js.map +1 -0
- package/dist/es/healthService.js +308 -0
- package/dist/es/healthService.js.map +1 -0
- package/dist/es/index.js +15 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/informationRoutes.js +298 -0
- package/dist/es/informationRoutes.js.map +1 -0
- package/dist/es/informationService.js +123 -0
- package/dist/es/informationService.js.map +1 -0
- package/dist/es/models/IHealthServiceConfig.js +4 -0
- package/dist/es/models/IHealthServiceConfig.js.map +1 -0
- package/dist/es/models/IHealthServiceConstructorOptions.js +2 -0
- package/dist/es/models/IHealthServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IInformationServiceConfig.js +2 -0
- package/dist/es/models/IInformationServiceConfig.js.map +1 -0
- package/dist/es/models/IInformationServiceConstructorOptions.js +2 -0
- package/dist/es/models/IInformationServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IPlatformServiceConfig.js +4 -0
- package/dist/es/models/IPlatformServiceConfig.js.map +1 -0
- package/dist/es/models/IPlatformServiceConstructorOptions.js +2 -0
- package/dist/es/models/IPlatformServiceConstructorOptions.js.map +1 -0
- package/dist/es/platformService.js +211 -0
- package/dist/es/platformService.js.map +1 -0
- package/dist/es/restEntryPoints.js +20 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/types/healthApplicationTask.d.ts +20 -0
- package/dist/types/healthRoutes.d.ts +20 -0
- package/dist/types/healthService.d.ts +42 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/informationRoutes.d.ts +60 -0
- package/dist/types/informationService.d.ts +60 -0
- package/dist/types/models/IHealthServiceConfig.d.ts +37 -0
- package/dist/types/models/IHealthServiceConstructorOptions.d.ts +15 -0
- package/dist/types/models/IInformationServiceConfig.d.ts +18 -0
- package/dist/types/models/IInformationServiceConstructorOptions.d.ts +10 -0
- package/dist/types/models/IPlatformServiceConfig.d.ts +10 -0
- package/dist/types/models/IPlatformServiceConstructorOptions.d.ts +19 -0
- package/dist/types/platformService.d.ts +57 -0
- package/dist/types/restEntryPoints.d.ts +5 -0
- package/docs/changelog.md +17 -0
- package/docs/examples.md +74 -0
- package/docs/open-api/spec.json +712 -0
- package/docs/reference/classes/HealthService.md +127 -0
- package/docs/reference/classes/InformationService.md +179 -0
- package/docs/reference/classes/PlatformService.md +209 -0
- package/docs/reference/functions/generateRestRoutesHealth.md +25 -0
- package/docs/reference/functions/generateRestRoutesInformation.md +25 -0
- package/docs/reference/functions/serverFavIcon.md +31 -0
- package/docs/reference/functions/serverHealth.md +31 -0
- package/docs/reference/functions/serverInfo.md +31 -0
- package/docs/reference/functions/serverLivez.md +31 -0
- package/docs/reference/functions/serverReadyz.md +31 -0
- package/docs/reference/functions/serverRoot.md +31 -0
- package/docs/reference/functions/serverSpec.md +31 -0
- package/docs/reference/index.md +34 -0
- package/docs/reference/interfaces/IHealthServiceConfig.md +79 -0
- package/docs/reference/interfaces/IHealthServiceConstructorOptions.md +25 -0
- package/docs/reference/interfaces/IInformationServiceConfig.md +27 -0
- package/docs/reference/interfaces/IInformationServiceConstructorOptions.md +11 -0
- package/docs/reference/interfaces/IPlatformServiceConfig.md +17 -0
- package/docs/reference/interfaces/IPlatformServiceConstructorOptions.md +33 -0
- package/docs/reference/variables/restEntryPoints.md +5 -0
- package/docs/reference/variables/tagsHealth.md +5 -0
- package/docs/reference/variables/tagsInformation.md +5 -0
- package/locales/en.json +14 -0
- package/package.json +57 -5
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { IHttpRequestContext, INoContentRequest, IRestRoute, IServerFavIconResponse, IServerInfoResponse, IServerLivezResponse, IServerReadyzResponse, IServerRootResponse, IServerSpecResponse, ITag } from "@3sixty/api-models";
|
|
2
|
+
/**
|
|
3
|
+
* The tag to associate with the routes.
|
|
4
|
+
*/
|
|
5
|
+
export declare const tagsInformation: ITag[];
|
|
6
|
+
/**
|
|
7
|
+
* The REST routes for server information.
|
|
8
|
+
* @param baseRouteName Prefix to prepend to the paths.
|
|
9
|
+
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
10
|
+
* @returns The generated routes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateRestRoutesInformation(baseRouteName: string, componentName: string): IRestRoute[];
|
|
13
|
+
/**
|
|
14
|
+
* Get the root for the server.
|
|
15
|
+
* @param httpRequestContext The request context for the API.
|
|
16
|
+
* @param componentName The name of the component to use in the routes.
|
|
17
|
+
* @param request The request.
|
|
18
|
+
* @returns The response object with additional http response properties.
|
|
19
|
+
*/
|
|
20
|
+
export declare function serverRoot(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerRootResponse>;
|
|
21
|
+
/**
|
|
22
|
+
* Get the information for the server.
|
|
23
|
+
* @param httpRequestContext The request context for the API.
|
|
24
|
+
* @param componentName The name of the component to use in the routes.
|
|
25
|
+
* @param request The request.
|
|
26
|
+
* @returns The response object with additional http response properties.
|
|
27
|
+
*/
|
|
28
|
+
export declare function serverInfo(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerInfoResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Get the livez for the server.
|
|
31
|
+
* @param httpRequestContext The request context for the API.
|
|
32
|
+
* @param componentName The name of the component to use in the routes.
|
|
33
|
+
* @param request The request.
|
|
34
|
+
* @returns The response object with additional http response properties.
|
|
35
|
+
*/
|
|
36
|
+
export declare function serverLivez(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerLivezResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Get the readyz for the server.
|
|
39
|
+
* @param httpRequestContext The request context for the API.
|
|
40
|
+
* @param componentName The name of the component to use in the routes.
|
|
41
|
+
* @param request The request.
|
|
42
|
+
* @returns The response object with additional http response properties.
|
|
43
|
+
*/
|
|
44
|
+
export declare function serverReadyz(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerReadyzResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Get the favicon for the server.
|
|
47
|
+
* @param httpRequestContext The request context for the API.
|
|
48
|
+
* @param componentName The name of the component to use in the routes.
|
|
49
|
+
* @param request The request.
|
|
50
|
+
* @returns The response object with additional http response properties.
|
|
51
|
+
*/
|
|
52
|
+
export declare function serverFavIcon(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerFavIconResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Get the spec for the server.
|
|
55
|
+
* @param httpRequestContext The request context for the API.
|
|
56
|
+
* @param componentName The name of the component to use in the routes.
|
|
57
|
+
* @param request The request.
|
|
58
|
+
* @returns The response object with additional http response properties.
|
|
59
|
+
*/
|
|
60
|
+
export declare function serverSpec(httpRequestContext: IHttpRequestContext, componentName: string, request: INoContentRequest): Promise<IServerSpecResponse>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { IInformationComponent, IServerInfo } from "@3sixty/api-models";
|
|
2
|
+
import type { IInformationServiceConstructorOptions } from "./models/IInformationServiceConstructorOptions.js";
|
|
3
|
+
/**
|
|
4
|
+
* The information service for the server.
|
|
5
|
+
*/
|
|
6
|
+
export declare class InformationService implements IInformationComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Runtime name for the class.
|
|
9
|
+
*/
|
|
10
|
+
static readonly CLASS_NAME: string;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new instance of InformationService.
|
|
13
|
+
* @param options The options to create the service.
|
|
14
|
+
*/
|
|
15
|
+
constructor(options: IInformationServiceConstructorOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Returns the class name of the component.
|
|
18
|
+
* @returns The class name of the component.
|
|
19
|
+
*/
|
|
20
|
+
className(): string;
|
|
21
|
+
/**
|
|
22
|
+
* The service needs to be started when the application is initialized.
|
|
23
|
+
* @returns A promise that resolves when the OpenAPI spec and favicon have been loaded from disk.
|
|
24
|
+
*/
|
|
25
|
+
start(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Get the root information.
|
|
28
|
+
* @returns The root information.
|
|
29
|
+
*/
|
|
30
|
+
root(): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the server information.
|
|
33
|
+
* @returns The service information.
|
|
34
|
+
*/
|
|
35
|
+
info(): Promise<IServerInfo>;
|
|
36
|
+
/**
|
|
37
|
+
* Get the favicon.
|
|
38
|
+
* @returns The favicon.
|
|
39
|
+
*/
|
|
40
|
+
favicon(): Promise<Uint8Array | undefined>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the OpenAPI spec.
|
|
43
|
+
* @returns The OpenAPI spec.
|
|
44
|
+
*/
|
|
45
|
+
spec(): Promise<unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* Is the server live.
|
|
48
|
+
* @returns The liveness status of the server.
|
|
49
|
+
*/
|
|
50
|
+
livez(): Promise<{
|
|
51
|
+
status: "alive" | "dead";
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Is the server ready.
|
|
55
|
+
* @returns The readyz status of the server.
|
|
56
|
+
*/
|
|
57
|
+
readyz(): Promise<{
|
|
58
|
+
status: "ready" | "not ready";
|
|
59
|
+
}>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for the health service.
|
|
3
|
+
*/
|
|
4
|
+
export interface IHealthServiceConfig {
|
|
5
|
+
/**
|
|
6
|
+
* The interval for checking the health of the components.
|
|
7
|
+
* @default 60000
|
|
8
|
+
*/
|
|
9
|
+
healthCheckInterval?: number;
|
|
10
|
+
/**
|
|
11
|
+
* The interval for running the application health lifecycle (init, application, teardown).
|
|
12
|
+
* @default 300000
|
|
13
|
+
*/
|
|
14
|
+
healthCheckApplicationInterval?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The initial interval for checking the health of the components and setting it in the health service.
|
|
17
|
+
* This is used to check the health of the components immediately after the service is started.
|
|
18
|
+
* @default 2000
|
|
19
|
+
*/
|
|
20
|
+
initialInterval?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to include stack traces in health check error details.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
includeErrorStack?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The URL of the module to use for the application health background task.
|
|
28
|
+
* If not provided, the default healthApplicationTask module will be used.
|
|
29
|
+
*/
|
|
30
|
+
overrideApplicationHealthTaskHandler?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The component types to exclude from the engine clone used by the application health
|
|
33
|
+
* background task. Each entry is a regular expression matched against the engine config
|
|
34
|
+
* type keys, for example "^rightsManagement" or "messaging.*Connector".
|
|
35
|
+
*/
|
|
36
|
+
excludeCloneComponents?: string[];
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IHealthServiceConfig } from "./IHealthServiceConfig.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the HealthService constructor.
|
|
4
|
+
*/
|
|
5
|
+
export interface IHealthServiceConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The background task component type to use for running application health checks.
|
|
8
|
+
* @default background-task
|
|
9
|
+
*/
|
|
10
|
+
backgroundTaskComponentType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The configuration for the service.
|
|
13
|
+
*/
|
|
14
|
+
config?: IHealthServiceConfig;
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IServerInfo } from "@3sixty/api-models";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for the information service.
|
|
4
|
+
*/
|
|
5
|
+
export interface IInformationServiceConfig {
|
|
6
|
+
/**
|
|
7
|
+
* The server information.
|
|
8
|
+
*/
|
|
9
|
+
serverInfo: IServerInfo;
|
|
10
|
+
/**
|
|
11
|
+
* The path to the OpenAPI Spec.
|
|
12
|
+
*/
|
|
13
|
+
openApiSpecPath?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The path to the favicon.
|
|
16
|
+
*/
|
|
17
|
+
favIconPath?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IInformationServiceConfig } from "./IInformationServiceConfig.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the InformationService constructor.
|
|
4
|
+
*/
|
|
5
|
+
export interface IInformationServiceConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The configuration for the service.
|
|
8
|
+
*/
|
|
9
|
+
config: IInformationServiceConfig;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IPlatformServiceConfig } from "./IPlatformServiceConfig.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the Platform Service constructor.
|
|
4
|
+
*/
|
|
5
|
+
export interface IPlatformServiceConstructorOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The entity storage for the tenants.
|
|
8
|
+
* @default tenant
|
|
9
|
+
*/
|
|
10
|
+
tenantEntityStorageType?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The logging component type to use for error logging.
|
|
13
|
+
*/
|
|
14
|
+
loggingComponentType?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Configuration for the service.
|
|
17
|
+
*/
|
|
18
|
+
config?: IPlatformServiceConfig;
|
|
19
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type IPlatformComponent, type TenantEventCallback, type TenantEventType } from "@3sixty/api-models";
|
|
2
|
+
import { type IContextIds } from "@3sixty/context";
|
|
3
|
+
import type { IPlatformServiceConstructorOptions } from "./models/IPlatformServiceConstructorOptions.js";
|
|
4
|
+
/**
|
|
5
|
+
* Service for performing platform operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PlatformService implements IPlatformComponent {
|
|
8
|
+
/**
|
|
9
|
+
* Runtime name for the class.
|
|
10
|
+
*/
|
|
11
|
+
static readonly CLASS_NAME: string;
|
|
12
|
+
/**
|
|
13
|
+
* Create a new instance of PlatformService.
|
|
14
|
+
* @param options The options for the connector.
|
|
15
|
+
*/
|
|
16
|
+
constructor(options?: IPlatformServiceConstructorOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Returns the class name of the component.
|
|
19
|
+
* @returns The class name of the component.
|
|
20
|
+
*/
|
|
21
|
+
className(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Indicates whether the component is running in a multi-tenant environment.
|
|
24
|
+
* @returns True if the component is running in a multi-tenant environment, false otherwise.
|
|
25
|
+
*/
|
|
26
|
+
isMultiTenant(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Execute a method, if single tenant will run once, if multi-tenant will run for each tenant.
|
|
29
|
+
* @param method The method to run for each tenant, returning false will stop any further iterations.
|
|
30
|
+
* @returns A promise that resolves when the method has been executed for all applicable tenants.
|
|
31
|
+
*/
|
|
32
|
+
execute(method: () => Promise<undefined | boolean> | Promise<void>): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the local origin context IDs for the given URL.
|
|
35
|
+
* @param url The URL to check.
|
|
36
|
+
* @returns A promise that resolves to the context IDs if the URL is a local origin, undefined otherwise.
|
|
37
|
+
*/
|
|
38
|
+
getLocalOriginContext(url: string): Promise<IContextIds | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Registers a callback to be invoked when a tenant event occurs.
|
|
41
|
+
* @param callbackId A unique identifier for the callback.
|
|
42
|
+
* @param callback The callback to invoke when a tenant event occurs.
|
|
43
|
+
*/
|
|
44
|
+
registerTenantEventCallback(callbackId: string, callback: TenantEventCallback): void;
|
|
45
|
+
/**
|
|
46
|
+
* Unregisters a previously registered tenant event callback.
|
|
47
|
+
* @param callbackId The identifier of the callback to unregister.
|
|
48
|
+
*/
|
|
49
|
+
unregisterTenantEventCallback(callbackId: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Fires all registered tenant event callbacks.
|
|
52
|
+
* @param tenantId The ID of the tenant for which the event occurred.
|
|
53
|
+
* @param eventType The type of event that occurred.
|
|
54
|
+
* @returns A promise that resolves when all callbacks have been invoked.
|
|
55
|
+
*/
|
|
56
|
+
fireTenantEvent(tenantId: string, eventType: TenantEventType): Promise<void>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.20.0-next.1](https://github.com/3sixtyglobal/api/compare/api-service-v0.20.0-next.0...api-service-v0.20.0-next.1) (2026-10-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* authorization ([#51](https://github.com/3sixtyglobal/api/issues/51)) ([023ef94](https://github.com/3sixtyglobal/api/commit/023ef94925114e88522cbe6f703d9b05a202bc6d))
|
|
9
|
+
* publish packages under the [@3sixty](https://github.com/3sixty) namespace ([91b1822](https://github.com/3sixtyglobal/api/commit/91b1822dba38f70692087ad4643572531d6634dc))
|
|
10
|
+
* updated ts compile ([d9a5c86](https://github.com/3sixtyglobal/api/commit/d9a5c86ec7dd1faf3045b5cd1e0d38a4b331313d))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* The following workspace dependencies were updated
|
|
16
|
+
* dependencies
|
|
17
|
+
* @3sixty/api-models bumped from 0.20.0-next.0 to 0.20.0-next.1
|
package/docs/examples.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Service Examples
|
|
2
|
+
|
|
3
|
+
These snippets demonstrate how to configure service-level URL generation and expose operational information for monitoring.
|
|
4
|
+
|
|
5
|
+
## InformationService
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { InformationService } from '@3sixty/api-service';
|
|
9
|
+
|
|
10
|
+
const infoService = new InformationService({
|
|
11
|
+
config: {
|
|
12
|
+
serverInfo: {
|
|
13
|
+
name: '3Sixty API',
|
|
14
|
+
version: '1.2.0'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
await infoService.start();
|
|
20
|
+
console.log(infoService.className()); // InformationService
|
|
21
|
+
|
|
22
|
+
const root = await infoService.root();
|
|
23
|
+
const info = await infoService.info();
|
|
24
|
+
const favicon = await infoService.favicon();
|
|
25
|
+
|
|
26
|
+
console.log(root); // 3Sixty API - 1.2.0
|
|
27
|
+
console.log(info.version); // 1.2.0
|
|
28
|
+
console.log((favicon?.byteLength ?? 0) > 0); // true
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import { InformationService } from '@3sixty/api-service';
|
|
33
|
+
|
|
34
|
+
const infoService = new InformationService({
|
|
35
|
+
config: {
|
|
36
|
+
serverInfo: {
|
|
37
|
+
name: '3Sixty API',
|
|
38
|
+
version: '1.2.0'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const spec = await infoService.spec();
|
|
44
|
+
const live = await infoService.livez();
|
|
45
|
+
const health = await infoService.health();
|
|
46
|
+
|
|
47
|
+
await infoService.setComponentHealth('queue', 'ok');
|
|
48
|
+
await infoService.removeComponentHealth('queue');
|
|
49
|
+
|
|
50
|
+
console.log(typeof spec); // undefined
|
|
51
|
+
console.log(live); // true
|
|
52
|
+
console.log(health.status); // ok
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## HostingService
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { HostingService } from '@3sixty/api-service';
|
|
59
|
+
|
|
60
|
+
const hostingService = new HostingService({
|
|
61
|
+
config: {
|
|
62
|
+
localOrigin: 'http://localhost:3000',
|
|
63
|
+
publicOrigin: 'https://api.example.org'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
console.log(hostingService.className()); // HostingService
|
|
68
|
+
|
|
69
|
+
const publicOrigin = await hostingService.getPublicOrigin('http://localhost:3000/users');
|
|
70
|
+
const usersUrl = await hostingService.buildPublicUrl('http://localhost:3000/users');
|
|
71
|
+
|
|
72
|
+
console.log(publicOrigin); // https://api.example.org
|
|
73
|
+
console.log(usersUrl); // https://api.example.org/users
|
|
74
|
+
```
|