@formio/appserver

中文文档
2.26.4发布于 2026/11/07OSL-3.0TypeScriptCommonJS近 30 天下载 4338

A highly performant and extensible Application Server for Form.io Multi-Tenant Deployments.

原始使用文档
文档目录5 节
  1. Form.io App Server
  2. Installation
  3. License
  4. Running Locally
  5. Environment Variables

Form.io App Server

The Form.io App Server is a performant run-time application server used to serve single project templates (including forms, resources, roles, etc) at a single deployed endpoint.

It's goals are as follows:

  • Provide a single project runtime server where non-submission resources are cached in memory.
  • Enable multi-tenant / multi-database deployments.
  • Provide extensible server-side functionality, like custom actions.
  • Support other databases besides MongoDB compliant databases for submission data.

Installation

To use this library, you must mount it within an Express.js application. As an example, you can create a simple Express.js application with this library by first creating a new Express.js application and then install and use the Server as follows.

npm install --save @formio/appserver

Then within your server.js file, you would add the following.

const express = require('express');
const app = express();
const { Server } = require('@formio/appserver');
(async function bootup() {
    // Create the server.
    const server = new Server();

    // Add the server router.
    app.use(await server.router());

    // Start server.
    app.listen(process.env.PORT, () => {
        console.log(`Server running on port ${process.env.PORT}`);
    });
})();

License

The Form.io App Server does require a license to run. If you are interested in trying out this technology, please contact us @ https://form.io/contact-us

Running Locally

To run this library locally, you can clone the repository, and then npm install.

yarn install

Then do the following.

cp .env.example .env

Now, within the .env file, modify all of the environment variables to be the correct values. Next, you can run the server using the following.

node index

Environment Variables

This library uses environment variables to configure the configurations required to run the server. These are as follows.

Variable NameRequiredDescriptionExample
MONGOyesYour MongoDB Connection string to use the default DB.mongodb://localhost:27017/appserver
PROJECTyesThe endpoint for your deployed Form.io Enterprise project.https://mydeployment.com/myproject
PROJECT_KEYyesThe API Key for your deployed Form.io Enterprise Project.abc123
APPSERVER_LICENSEyesYour License Key for this App Server deployment.
PORTnoThe port that your server will run on. Default 30053005
JWT_SECRETyesThe key used to protect your JWT authentication tokens.YOUR_SECRET_KEY
JWT_EXPIRE_TIMEnoThe number of minutes the server's own tokens last.60
PORTAL_SECRETnoProvides the ability to connect to the App Server via the Remote Environment Connection within your Developer Portal.YOUR_SECRET_KEY
PROJECT_CACHEnoDisables the cache for project resources (such as Project template, Project Settings, and Access Settings). Default "true"true
PROJECT_TTLnoHow often, in seconds, the project's forms, resources and actions are loaded again, which is how changes made in the portal or deployed to the project reach the App Server. 0 disables refreshing. Default 900900
TEMPLATE_SYNCnoWhen the forms, resources and actions in a module's template that the project is missing are installed into it: boot once at startup, refresh also on every PROJECT_TTL refresh, or off never. Nothing the project already has is changed. The project remains the source of truth, so use off when forms are managed through stage deployments. Default "boot"boot
MONGO_CONFIGnoAdditional configurations to add to the DB connection string{}

Enjoy

  • The Form.io Team

版本与发布记录

@formio/appserver 共发布 126 个版本,首次发布于 2023/04/27;过去 12 个月发布了 47 个版本。

版本发布日期距今
2.26.4latest2026/11/078 天前
2.26.32026/11/079 天前
2.26.22026/11/069 天前
2.26.12026/11/0610 天前
2.26.02026/11/0510 天前
2.25.22026/10/3116 天前

其他发布通道:dev → 2.0.0-dev.40,rc → 2.12.1-rc.1。

关于 @formio/appserver 的常见问题

@formio/appserver 是什么?

A highly performant and extensible Application Server for Form.io Multi-Tenant Deployments.

如何安装 @formio/appserver?

在项目目录运行 npm install @formio/appserver,或使用 pnpm add / yarn add / bun add。

@formio/appserver 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@formio/appserver 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@formio/appserver 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@formio/appserver 可以商用吗?

@formio/appserver 使用 OSL-3.0 许可。声明的许可为 OSL-3.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@formio/appserver 的下载量有多少?

根据 npm 官方下载统计,@formio/appserver 在 2026/10/16 – 2026/11/14 这 30 天内被下载 4,338 次,日均约 145 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@formio/appserver 还在维护吗?

最新版本 2.26.4 发布于 2026/11/07(8 天前);至今共发布 126 个版本,其中过去 12 个月发布了 47 个;首次发布于 2023/04/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。