@adobe/asset-compute-devtool 中文文档教程
Asset Compute Development Tool
这是用于开发人员工具的库,用于探索和测试 Adobe Asset Compute 服务。
Installation
$ npm install @adobe/asset-compute-devtool
Usage
Devtool Server 有一个用于启动和停止服务器的简单 api:
const { DevtoolServer } = require('@adobe/asset-compute-devtool');
const devtool = new DevtoolServer();
await devtool.run(); // starts server and opens a browser
// ... use developer tool
await devtool.stop(); // stop server
使用首选端口:
const { DevtoolServer } = require('@adobe/asset-compute-devtool');
const devtool = new DevtoolServer();
await devtool.run(8080); // starts server and binds it to port 8080 or the closest port to 8080 if it is already in use
console.log(devtool.port); // should be 8080 unless that port was already in use
// ... use developer tool
await devtool.stop(); // stop server
使用启动功能设置服务器:
const { start } = require('@adobe/asset-compute-devtool');
const devtool = await start(); // create DevtoolServer instance and run server
// ... use developer tool
await devtool.stop();
参见 adobe/aio-cli-plugin-asset-compute 示例用法。
Further Documentation
有关详细信息,请参阅资产计算开发工具
Asset Compute Development Tool
This is a library for the developer tool for exploring and testing the Adobe Asset Compute service.
Installation
$ npm install @adobe/asset-compute-devtool
Usage
The Devtool Server has a simple api for starting and stopping the server:
const { DevtoolServer } = require('@adobe/asset-compute-devtool');
const devtool = new DevtoolServer();
await devtool.run(); // starts server and opens a browser
// ... use developer tool
await devtool.stop(); // stop server
Using a preferred port:
const { DevtoolServer } = require('@adobe/asset-compute-devtool');
const devtool = new DevtoolServer();
await devtool.run(8080); // starts server and binds it to port 8080 or the closest port to 8080 if it is already in use
console.log(devtool.port); // should be 8080 unless that port was already in use
// ... use developer tool
await devtool.stop(); // stop server
Using start function to set up server:
const { start } = require('@adobe/asset-compute-devtool');
const devtool = await start(); // create DevtoolServer instance and run server
// ... use developer tool
await devtool.stop();
See adobe/aio-cli-plugin-asset-compute for an example usage.
Further Documentation
Refer to Asset Compute Development Tool for more information