当前位置:网站首页>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 !
边栏推荐
- Comparator sort functional interface
- MySQL master-slave replication
- 物联网?快来看 Arduino 上云啦
- Dingding, Feishu, and enterprise wechat: different business approaches
- [log service CLS] Tencent cloud log service CLS accesses CDN
- Engage in audio and video development? Several things I have to say about SRT live broadcast protocol
- Teach you how to use airtestide to connect your mobile phone wirelessly!
- J'a i ouvert quelques mots d'un ami et quelques réflexions personnelles sur le livre des six ancêtres
- The data value reported by DTU cannot be filled into Tencent cloud database through Tencent cloud rule engine
- LVGL库入门教程 - 颜色和图像
猜你喜欢

go Cobra命令行工具入门

线程同步的基石AbstractQueuedSynchronizer详解

Parse NC format file and GRB format file dependent package edu ucar. API learning of netcdfall

Beauty of script │ VBS introduction interactive practice

Creation and use of unified links in Huawei applinking

Parti,谷歌的自回归文生图模型

Who said that "programmers are useless without computers? The big brother around me disagrees! It's true

Interviewer: the MySQL database is slow to query. What are the possible reasons besides the index problem?
![[2022 national tournament simulation] BigBen -- determinant, Du Jiao sieve](/img/ec/6c6e3d878e2a05a6e7a4ca336ae134.jpg)
[2022 national tournament simulation] BigBen -- determinant, Du Jiao sieve

Kubernetes cluster deployment
随机推荐
“我这个白痴,招到了一堆只会“谷歌”的程序员!”
One article explains R & D efficiency! Your concerns are
Concept + formula (excluding parameter estimation)
MySQL foreign key impact
1、贪吃蛇游戏设计
线程同步的基石AbstractQueuedSynchronizer详解
一文理解OpenStack网络
Quickly understand the commonly used message summarization algorithms, and no longer have to worry about the thorough inquiry of the interviewer
Baidu simian: talk about persistence mechanism and rdb/aof application scenario analysis!
Preparation and operation & Maintenance Guide for 'high concurrency & high performance & high availability service program'
How to do research on plant endophytes? Special topic on Microbiology
SMS SMS
Detailed explanation of abstractqueuedsynchronizer, the cornerstone of thread synchronization
On the value foam of digital copyright works from the controversial nature of "Meng Hua Lu"
openGauss内核:简单查询的执行
LVGL库入门教程 - 颜色和图像
Parti,谷歌的自回归文生图模型
面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
Definition and use of constants in C language
初中级开发如何有效减少自身的工作量?