Create a Service
Creating a new custom service involves a few important steps:
Create the Service
Create the service source file in a new folder within the src/services
folder. For example to create a new service called ExampleService
, create a new file called ExampleService.ts
in src/services/ExampleService
with the following content:
If you want your service to be able to serialize and deserialize configuration specific to the service from app.json
, you can extend from ConfigurableServiceBase
instead:
Register the Service
Finally we need to register the service with the Geocortex Web service registry so that it is aware of your new service.
To simplify the module imports, we'll make a new file in the ExampleService
folder called index.ts
. Note that this file is for convenience, and is not required:
Now register your service with the service registry by modifying the src/index.ts
file:
Next Steps
Deploy your Service
Learn how to deploy your custom service
Create a Service that Manages Dynamic Data
Follow along with a more in depth service example