Welcome to Port

More Easily Create an API with Port App, designed to streamline the deployment of APIs for developers. With this tool, developers can effortlessly deploy APIs and integrate various applications to build a unified web service. Port Application simplifies the process, enabling developers to focus on creating seamless and efficient solutions with ease.

Please see the documentation lincense

The Requirements


Download URL


VERSION OS STABLE URL
v1.0.24 Windows x64 No v1.0.24-win-installer
v1.0.23 Windows x64 No v1.0.23-win-installer
v1.0.22 Windows x64 No v1.0.22-win-installer

Repository


To deploy APIs, you must first store the API definitions in the repository before proceeding with the deployment. Please refer to the instructions below for guidance on storing and deploying your APIs after saving them to the repository.

Creates a repository

port new [repository-name]

Layout

port.toml         # The configuration file.
.enum             # The custom enum file 
API-A-Group/      # The group directory. 
    sample1.msg   # The message file
    sample2.msg   # The message file
    sample3.msg   # The message file

API-B-Group/      # The group directory. 
    sample1.msg   # The message file
    sample2.msg   # The message file
    sample3.msg   # The message file
...               # Other files.

Tip

The repository name cannot contain special characters. It follows the directory naming rules provided by the operating system.


Creates a group

port add [group-name]

Message (*.msg)

A message is an object that allows users to specify API properties in a pre-provided Application Service. The message is a kv, and types and properties can be defined in that message. Please attach the materials attached below.


message attribute

name description
api Real-time synchronization and messaging are handled within the corresponding external library. For more details, please refer to the api documentation.
backup Changes are saved to the backup database as they occur, ensuring that values are restored upon application restart. and values are not propagated api messages during program execution.
property Can specify a custom property
rule Can specify rules to manage the values of corresponding messages.

sample1.msg

 DevAPowerStatus    enum.DeviceAStatus  api:DeviceA.GetStatus         
 DevAErrorMessage   text                api:DeviceA.GetErrorMessage property:{"Arguments":"1,0"}
 DevCTemperature    num                 api:DeviceC.GetTemperature property:{"MIN":0,"MAX":300}
 DevCOnOff          enum.OnOff          api:DeviceC.OnOff           
 ...

Tip

message document do not using special characters.

Enum (*.enum)


Enums are particularly useful when you have a fixed set of values that a variable can take, such as days of the week, months of the year, or status codes. They help make your code more expressive, self-documenting, and less error-prone because you're working with named constants instead of raw integer values.

custom.enum

TFalse      True:0      False:1
FTrue       False:0     True:1

Commands


Cheat Sheet

command arguments description
? [script] Runs the specified script.
version - Displays the version information.
new [name] Can specify rules to manage the values of corresponding messages.
push - Push project to repository.
pull - Pull project from repository.
set [group-name|pkg-name] [message-name] [value] Set values in the API server.
get [group-name|pkg-name] [message-name] Get values from the API server.
load [pkg-name] Loads the package into the currently running API server.
save [pkg-name] [filefullname] Save the package.
init [pkg-name] Initializes the Package.
event [pkg-name] Displays a events.
run [name] Runs the API server based on the specified repository.
ls [repo]|[pkg]|[tcp]|[comm] Displays the specified items in a list.
queue

[new] [name]

[ls]

[view] [name]

[push] [name] [value]

[pop] [name]

Create new queue.

Displays queue list.

Displays queue items.

Push a item to queue.

Pop a item from queue.

stack

[new] [name]

[ls]

[view] [name]

[push] [name] [value]

[pop] [name]

Create new stack.

Displays stack list.

Displays stack items.

Push a item to stack.

Pop a item from stack.

storage

[new] [name]

[ls]

[view] [name]

[set] [name] [key] [value]

[get] [name] [key]

Create new storage.

Displays storage list.

Displays storage items.

Push a item to storage.

Pop a item from storage.

list

[new] [name]

[ls]

[view] [name]

[add] [name] [value]

[insert] [name] [index] [value]

[remove] [name] [index] [value]

Create new list.

Displays a lists.

Displays list items.

Add a item.

Insert a item.

Remove a item.

kill [kill-code] Shutdown API server.
flow

[load] [flow-key]

[init] [flow-key]

[remove] [flow-key]

[event] [flow-key]

Loads the Flow resource into the currently running API server.

Initializes the Flow resource.

Remove Flow resource

Displays a events from the Flow resource.

env - Displays the system environment settings.
help - .

Repository

Tip

The application runs based on the values stored in the repository. The push action must precede the application startup. Subsequently, users can perform a pull action at any desired moment to restore the repository.

Server

Message

port set groupA sayHelloMessage1 Hello?
[set-ok]
port get groupA sayHelloMessage1
[Hello?]