Defining Services

Simplifying (micro-)service development

Encore.ts makes it simple to build applications with one or many services, without needing to manually handle the typical complexity of developing microservices.

Defining services

To create an Encore service, add a file named encore.service.ts in a directory.

The file must export a service instance, by calling new Service, imported from encore.dev/service.

For example:

import { Service } from "encore.dev/service"; export default new Service("my-service");

That's it! Encore will consider this directory and all its subdirectories as part of the service.

For more on how to structure your application, see the app structure guide.