자원을 찾기 위해 115 네트워크 디스크
[영구 핵심 고객 서비스 : 5828 즈 0650] █
영원한 고객 [핵심 : 4058 즈 3626] █
첫째, 준비
-
설치 OpenResty . 다운로드 공식 웹 사이트의 세부 사항은, 문서를 설치
- 설치 IDEA . 동시에 다음과 같은 플러그인 설치
- 소요
- nginx를 지원
- OpenResty 루아 지원
둘째, 생성 및 구성 프로젝트
-
의 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"
-