115あなたはどのようなリソースを知っています
[永久コア顧客サービス:5828 ZU 0650]█
永久顧客[コア:4058 ZU 3626]█
まず、準備
-
インストールOpenResty。ダウンロードする公式サイトの詳細は、ドキュメントをインストール
- インストールIDEA。同時に、以下のプラグインをインストール
- 取ります
- nginxのサポート
- OpenResty Luaのサポート
第二に、作成および設定プロジェクト
-
luademo1というファイルを作成
Lua
プロジェクトを -
作成
conf
、src
カタログ、および追加nginx.conf
、build.xml
およびhelloworld.lua
ファイル-
nginx.conf
ファイルworker_processes 1; error_log logs/error.log info; events { worker_connections 1024; } http { default_type application/octet-stream; access_log logs/access.log; lua_package_path 'luademo1/?.lua;;'; server { listen 8080; server_name localhost; default_type text/html; location = /favicon.ico { log_not_found off; access_log off; } location /test { content_by_lua_file luademo1/helloworld.lua; } } }
-
helloworld.lua
ファイルlocal hello = function () ngx.say("Hello world,Lua!") end hello()
-
build.xml
ファイル<?xml version="1.0" encoding="UTF-8"?> <project name="luademo1" default="dist" basedir="."> <description> run pic-server </description> <!-- set global properties for this build --> <property name="openresty-home" location="D:\openresty-1.15.8.2-win64"/> <property name="conf" location="${basedir}/conf"/> <property name="src" location="${basedir}/src"/> <property name="target-conf" location="${openresty-home}/conf"/> <property name="target-src" location="${openresty-home}/${ant.project.name}"/> <echo>######开发版本的ant配置#####</echo> <target name="clean" depends=""> <echo>清理openresty目录${dist}下的conf,logs,janus,januslib</echo> <delete dir="${target-conf}"/> <delete dir="${target-src}"/> <delete> <fileset dir="${openresty-home}/logs" includes="*.log"> </fileset> </delete> </target> <target name="init"
-