当前位置:网站首页>8 lines of code to teach you how to build an intelligent robot platform
8 lines of code to teach you how to build an intelligent robot platform
2022-06-24 13:18:00 【Brother tortoise】
In our traditional application development , It is basically necessary to deploy an application server , And by serverless There is no need to build a server to deploy our own applications , There is no need to deploy the corresponding environment , Just a few lines of code are required to deploy our application online . Don't talk much , Let's show you the effect picture first .
Above is an intelligent calculator application , adopt 8 With a line of code, we can deploy our own smart calculator , Of course, you can also experience other interesting functions .
1 preparation
- linux,mac Such as the environment ( Just have one of them , It can't be windows), without , use ubuntu Virtual machine or linux Web servers can also ( Not necessary ), Today we mainly introduce the use of ubuntu The way virtual machines work
- Flybook open platform account registration
- Flying book download 1.1 Some reference links
- vmware Install Links :https://my.vmware.com/cn/web/vmware/downloads
- ubuntu18.04 Image download :http://mirrors.aliyun.com/ubuntu-releases/18.04.5/
- rust Environment configuration link :https://github.com/secondstate/serverlessreactorstarter/blob/main/README.md
- Flying book download windows App download link :https://www.feishu.cn/download
- Flybook open platform account registration :https://passport.feishu.cn/create 6.Serverless Reactor Official website : http://reactor.secondstate.info/2 Create robot application based on flybook open platform 2.1 Fly book open platform account registration click the link :https://passport.feishu.cn/create/?redirect_uri=https%3A%2F%2Fopen.feishu.cn%2Fapp%2Fcli_a02624f5b838d013%2Fevent&app_id=7&lang=zh-CNAfter registration, use the mobile number to log in
Flybook open platform main interface
2.2 Create robot applications
Click on Create an
Create enterprise self built applications
Fill in the application basic information , Click OK to create
The current app is in the pending status
2.3 Configure robot application information
Click the application just created , Click on robot
Click enable robot
3 Serverless Reactor Configure flybook application
Serverless Reactor Facing the flying book 、Slack、 Developers of instant messaging tools such as nail , Provide developers with the development experience of quickly building online third-party applications . adopt Serverless Reactor, Developers only need to focus on the implementation of business logic , There is no need to build an application server 、 Domain name filing 、 Data storage and other cumbersome processes . Program usage WebAssembly(WASM) distribution ,runtime Use WasmEdge-napi, Give developers greater freedom of language choice , And ensure the implementation efficiency .
The specific process is as follows :
Developers put every... Required by the flybook platform callback Write it as a function
The developer uploads the function code to Serverless Reactor platform , Receive a callback URL
Developers put this callback URL Filling in the flybook platform requires callback The place of
register Serverless Reactor account number ( Register via email )
After registration, the email will receive a link , Click verify , Then log in
Log in to the home page
Click on the top left corner apps
Click Create new app
Fill in the welcome message and click finish
The welcome message is json Format , Displays when the robot is enabled
In the list, you can see the application we just created
4 Upload the user-defined function configuration file
The default here is that you have already set up ubuntu Virtual machine environment
4.1 install nmp Environmental Science
Enter the following command at the terminal
curl --silent --location https://rpm.nodesource.com/setup_10.x | bash - yum install -y nodejs npm install -g cnpm --registry=https://registry.npm.taobao.org npm install npm run build npm -v
4.2 To configure rust and rustwasmc Environmental Science
Enter the following command at the terminal to install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Enter the following command at the terminal to install rustwasmc( Administrator mode , You need to enter a password )
sudo npm install -g rustwasmc --unsafe-perm
4.3 fork Calculator source code to local
github link :https://github.com/second-state/serverless-reactor-starter
download zip Compress the package locally
unpack
Files generated after decompression
Open the terminal in the folder
Right click in the folder and select open in terminal
Enter the following command
rustwasmc bulid
After compiling, you can see that there is one more in the original folder pkg Folder
It produces what we need to go to bed .wasm file
4.4 Upload .wasm file
go back to Serverless Reactor main interface , Click on upload wasm file
Will just generate the .wasm Files can now be dragged to the virtual machine windows Uploading in ( install vmtools You can directly drag )
Copy after upload service url
Back to the flying book open platform , Click on Time subscription
Edit request URL , Copy just now service url copied
It should be noted that after copying the web address, you need to add
/internal
Add event
4.5 Version release
Create a new version in version publishing and management
Version filling 1.0 that will do
Click save
Then apply for release
Waiting for approval
5 Install flybook application locally
5.1 Register and log in to flybook
With windows For example
Download link :https://www.feishu.cn/download
After downloading the installation package, you can install it by default
Log in after installation
Application main interface
Search for calculators in the search bar
You can see the application we created
5.2 Computer robot application experience
The experience was pretty good , Welcome to try !
边栏推荐
- Cohere、OpenAI、AI21联合发布部署模型的最佳实践准则
- Brief introduction to cluster analysis
- One article explains R & D efficiency! Your concerns are
- Pycharm中使用Terminal激活conda服务(终极方法,铁定可以)
- The agile way? Is agile development really out of date?
- Implement Domain Driven Design - use ABP framework - create entities
- 短信服务sms
- 16 safety suggestions from metamask project to solid programmers
- Sms service sms
- Getting started with the go Cobra command line tool
猜你喜欢

系统测试主要步骤

Comparator 排序函数式接口

nifi从入门到实战(保姆级教程)——环境篇

Use terminal to activate CONDA service in pypharm (the ultimate method is definitely OK)

The text to voice function is available online. You can experience the services of professional broadcasters. We sincerely invite you to try it out

CVPR 2022 - Interpretation of selected papers of meituan technical team

华为AppLinking中统一链接的创建和使用

1、贪吃蛇游戏设计

敏捷之道 | 敏捷开发真的过时了么?

钉钉、飞书、企业微信:迥异的商业门道
随机推荐
“我这个白痴,招到了一堆只会“谷歌”的程序员!”
what the fuck! I'm flattered. He actually wrote down the answers to the redis interview questions that big companies often ask!
What if the WordPress website forgets its password
[2022 national tournament simulation] BigBen -- determinant, Du Jiao sieve
Nifi from introduction to practice (nanny level tutorial) - environment
Engage in audio and video development? Several things I have to say about SRT live broadcast protocol
Leetcode 1218. Longest definite difference subsequence
天猫618农产品“百强县” 35个县域来自中西部及东北
Configure Yum proxy
YOLOv6:又快又准的目标检测框架开源啦
Sms service sms
LVGL库入门教程 - 颜色和图像
系统测试主要步骤
Sinomeni vine was selected as the "typical solution for digital technology integration and innovative application in 2021" of the network security center of the Ministry of industry and information te
Concept + formula (excluding parameter estimation)
Kubernetes cluster deployment
Design and implementation of high performance go log library zap
go Cobra命令行工具入门
Another prize! Tencent Youtu won the leading scientific and technological achievement award of the 2021 digital Expo
How to do research on plant endophytes? Special topic on Microbiology