---
lang: en
title: 'API docs: core.asservice'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/core
permalink: /doc/en/lb4/apidocs.core.asservice.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/core](./core.md) &gt; [asService](./core.asservice.md)

## asService() function

Create a binding template for a service interface

<b>Signature:</b>

```typescript
export declare function asService(serviceInterface: ServiceInterface): BindingTemplate;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  serviceInterface | [ServiceInterface](./core.serviceinterface.md) | Service interface |

<b>Returns:</b>

[BindingTemplate](./context.bindingtemplate.md)


