当前位置:网站首页>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 !
边栏推荐
- Concept + formula (excluding parameter estimation)
- 快速了解常用的消息摘要算法,再也不用担心面试官的刨根问底
- How to solve the problem that MBR does not support partitions over 2T, and lossless transfer to GPT
- Istio Troubleshooting: uneven grpc service load
- Nifi from introduction to practice (nanny level tutorial) - environment
- The text to voice function is available online. You can experience the services of professional broadcasters. We sincerely invite you to try it out
- J'a i ouvert quelques mots d'un ami et quelques réflexions personnelles sur le livre des six ancêtres
- Main steps of system test
- "I, an idiot, have recruited a bunch of programmers who can only" Google "
- 105. simple chat room 8: use socket to transfer pictures
猜你喜欢

Beauty of script │ VBS introduction interactive practice

系统测试主要步骤

Dingding, Feishu, and enterprise wechat: different business approaches

“我这个白痴,招到了一堆只会“谷歌”的程序员!”

MySQL foreign key impact

解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习

物联网?快来看 Arduino 上云啦

openGauss内核:简单查询的执行

Understanding openstack network

Kubernetes集群部署
随机推荐
钉钉、飞书、企业微信:迥异的商业门道
Nifi from introduction to practice (nanny level tutorial) - environment
Summary of the process of restoring damaged data in MySQL database
C语言中常量的定义和使用
About the hacked database
[day ui] affix component learning
Party, Google's autoregressive Wensheng graph model
How to solve the problem that MBR does not support partitions over 2T, and lossless transfer to GPT
Interviewer: the MySQL database is slow to query. What are the possible reasons besides the index problem?
华为AppLinking中统一链接的创建和使用
Concept + formula (excluding parameter estimation)
短信服务sms
Use terminal to activate CONDA service in pypharm (the ultimate method is definitely OK)
Mlife forum | microbiome and data mining
Open source monitoring system Prometheus
Boss direct employment IPO: both the end and the beginning
How to efficiently analyze online log
Preparation and operation & Maintenance Guide for 'high concurrency & high performance & high availability service program'
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
我開導一個朋友的一些話以及我個人對《六祖壇經》的一點感悟