Define the resources for your app
modus.json
file within the root of directory of your app.
endpoints
object in the app manifest allows you to define these endpoints for
integration into your frontend or federated API.
Each endpoint requires a unique name, specified as a key containing only
alphanumeric characters and hyphens.
"graphql"
for this endpoint type./
."bearer-token"
or
"none"
. See Authentication for additional details.connections
object in the app manifest allows you to define these
hosts, for secure access from within a function.
Each connection requires a unique name, specified as a key containing only
alphanumeric characters and hyphens.
Each connection has a type
property, which controls how it’s used and which
additional properties are available. The following table lists the available
host types:
Type | Purpose | Functions Namespaces |
---|---|---|
http | Connect to an HTTP(S) web server | http , graphql , models |
postgresql | Connect to a PostgreSQL database | postgresql |
dgraph | Connect to a Dgraph database | dgraph |
"http"
for this connection type."https://api.example.com/v1/"
"https://models.example.com/v1/classifier"
baseUrl
or an endpoint
, but not both.baseUrl
for connections to a host with a common base URL.endpoint
for connections to a specific URL.baseUrl
field. However, some APIs, such as
graphql.execute
, require the full URL in the endpoint
field.{{VARIABLE}}
template syntax, which
resolve at runtime to secrets provided for each connection, via the Hypermode
Console.Examples
Authorization
that uses the Bearer
scheme. A secret named AUTH_TOKEN
provides the token:X-API-Key
provided by a secret named
API_KEY
:USERNAME
and PASSWORD
combined and then are
base64-encoded to form a compliant Authorization
header value:{{VARIABLE}}
template syntax, which
resolve at runtime to secrets provided for each connection, via the Hypermode
Console.Example
key
provided by a secret named
API_KEY
:"postgresql"
for this connection type.{{VARIABLE}}
template syntax, which
resolve at runtime to secrets provided for each connection, via the Hypermode
Console.The connection string in the preceding example includes:PG_USER
& PG_PASSWORD
db.example.com
on port 5432
data
require
- which is highly recommended for secure connections"dgraph"
for this connection type.models
object in the app
manifest allows you to easily define models, whether hosted by Hypermode or
another host.
Each model requires a unique name, specified as a key, containing only
alphanumeric characters and hyphens.
hugging-face
is currently the only supported
option."hypermode"
for models that Hypermode hosts.connections
section of the manifest.hugging-face
as the provider
and hypermode
as the connection
,
Hypermode automatically facilitates the connection to an instance of a shared or
dedicated instance of the model. Your project’s functions securely access the
hosted model, with no further configuration required. For more details, see
hosted models.collections
object allows you to define indexed data
types that are automatically embedded and searchable based on the search method
you define.
Each collection requires a unique name, specified as a key, containing only
alphanumeric characters and hyphens.
For more detail on implementing collections, see Search.
type
:
specifies the type of the index. For example, sequential
(default).