名称

Mojo::UserAgent::Server-应用程序服务器

简介

使用Mojo::UserAgent::Server;my$server=Mojo::UserAgent::server->new;说$server->url;

描述

Mojo::UserAgent::服务器是基于Mojo::服务器::守护程序处理请求的Mojo::用户代理.

属性

Mojo::UserAgent::服务器实现以下属性。

奥洛普

我的$loop=$server->ioloop;$server=$server->ioloop(Mojo::ioloop->new);

用于I/O操作的事件循环对象,默认为全局Mojo::IOLoop独生子女。

方法

Mojo::UserAgent::服务器从继承所有方法Mojo::基础并实现了以下新功能。

应用程序

my$app=Mojo::UserAgent::Server->app;Mojo::UserAgent::服务器->应用程序(Mojolicus->新建);我的$app=$server->app;$server=$server->app(Mojolicios->new);

此服务器处理的应用程序,特定于实例的应用程序将覆盖全局默认值。

#更改应用程序行为$server->app->defaults(测试=>'oh yea!');

nb_url

我的$url=$server->nb_url;我的$url=$server->nb_url(“http”);我的$url=$server->nburl('https');

获得绝对值Mojo::URL用于服务器处理非阻塞请求的对象“应用程序”和交换协议(如果需要)。

重新启动

$server->重新启动;

使用新端口重新启动服务器。

网址

我的$url=$server->url;我的$url=$server->url('http');我的$url=$server->url('https');

获得绝对值Mojo::URL用于服务器处理阻塞请求的对象“应用程序”和交换协议(如果需要)。

另请参阅

Mojolicious公司,Mojolicious::指南,https://mojolicious.org.