当前位置:网站首页>Hello world of vertx
Hello world of vertx
2022-07-03 07:25:00 【Sleeping Empire】
1. maven Project dependence
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-web</artifactId>
</dependency>
2. Project part code
public class MainVerticle extends AbstractVerticle {
@Override
public void start(Promise<Void> startPromise) throws Exception {
vertx.createHttpServer().requestHandler(req ->
req.response()
.putHeader("content-type", "text/plain")
.end("Hello from Vert.x!")
).listen(8888, http -> {
if (http.succeeded()) {
startPromise.complete();
System.out.println("HTTP server started on port 8888");
} else {
startPromise.fail(http.cause());
}
});
}
}
Project start item
public class HelloWorldApplication {
public static void main(String[] args) {
Vertx vertx = Vertx.vertx();
vertx.deployVerticle(MainVerticle.class.getName());
}
}
3. Project test
After the project starts , Enter the address in the browser :http://127.0.0.1:8888; You can see the page information :Hello from Vert.x!
4. Full address of the project
边栏推荐
- 不出网上线CS的各种姿势
- twenty million two hundred and twenty thousand three hundred and nineteen
- OSI knowledge sorting
- Summary of abnormal mechanism of interview
- JS monitors empty objects and empty references
- PAT甲级真题1166
- [Fiddler problem] solve the problem about Fiddler's packet capturing. After the mobile network is configured with an agent, it cannot access the Internet
- SQL create temporary table
- Jeecg menu path display problem
- Advanced API (UDP connection & map set & collection set)
猜你喜欢
TCP cumulative acknowledgement and window value update
Final, override, polymorphism, abstraction, interface
Gridome + strapi + vercel + PM2 deployment case of [static site (3)]
VMWare网络模式-桥接,Host-Only,NAT网络
"Baidu Cup" CTF game 2017 February, Web: blast-1
Wireshark software usage
Basic knowledge about SQL database
Use of file class
高并发内存池
最全SQL与NoSQL优缺点对比
随机推荐
PHP install composer
Book recommendation~
Basic components and intermediate components
Store WordPress media content on 4everland to complete decentralized storage
20220319
Raspberry pie update tool chain
Leetcode 213: 打家劫舍 II
Hash table, generic
3311. 最长算术
Win 2008 R2 crashed at the final installation stage
Laravel Web Framework
Common problems in io streams
Common analysis with criteria method
"Moss ma not found" solution
4EVERLAND:IPFS 上的 Web3 开发者中心,部署了超过 30,000 个 Dapp!
在 4EVERLAND 上存储 WordPress 媒体内容,完成去中心化存储
Margin left: -100% understanding in the Grail layout
Circuit, packet and message exchange
TypeScript let与var的区别
twenty million two hundred and twenty thousand three hundred and nineteen