2. In your express code, use `createPartialContentHandler` factory method to generate an express handler for serving partial content for the route of your choice:
This function _needs to be implemented by you_. It's purpose is to fetch and return `Content` object containing necessary metadata and methods to stream the content partially. This method is invoked by the express handler (returned by `createPartialContentHandler`) on each request.
-`Request`: It receives the `Request` object as it's only input. Use the information available in `Request` to find the requested content, e.g. through `Request.params` or query string, headers etc.
### Returns:
-`Promise<Content>`: See below.
### Throws:
-`ContentDoesNotExistError`: Throw this to indicate that the content doesn't exist. The generated express handler will return a 404 in this case.
> Note: Any message provided to the `ContentDoesNotExistError` object is returned to the client.
## Content object:
This object contains metadata and methods which describe the content. The `ContentProvider` method builds and returns it.
### Properties:
All the properties of this object are used to return content metadata to the client as various `Response` headers.
-`fileName`: Used as the `Content-Disposition` header's `filename` value.
-`mimeType`: Used as the `Content-Type` header value.
-`totalSize`: Used as the `Content-Length` header value.
### Methods:
-`getStream(range?: Range)`: This method should return a readable stream initialized to the provided `range` (optional). You need to handle two cases:
- range is `null`: When `range` is not-specified, the client is requesting the full content. In this case, return the stream as it is.
- range is `{start, end}`: When client requests partial content, the `start` and `end` values will point to the corresponding byte positions (0 based and inclusive) of the content. You need to return stream limited to these positions.