关于nginx:OpenResty-项目脚手架

1次阅读

共计 813 个字符,预计需要花费 3 分钟才能阅读完成。

OpenResty 我的项目模板,新我的项目能够 clone 下来批改

我的项目地址:https://github.com/fengjx/ope…

相干浏览

  • OpenResty 从入门到开发一个网关服务
  • OpenResty 最佳实际
  • 跟我学 OpenResty(Nginx+Lua) 开发

环境依赖

  • openresty
  • luarocks

make cmd

$ make help

Makefile cmd:

    deps:                装置依赖
    start:                启动服务(前台过程)start:                启动服务(后盾过程)start:                进行服务
    start:                进行服务
    help:                Makefile 帮忙 

疾速开始

# 下载我的项目模板
$ git clone https://github.com/fengjx/openresty-quick-start.git

# 删除 git 文件
$ rm -rf .git

# 批改我的项目名
$ mv openresty-quick-start my-project

$ cd my-project

# 装置依赖
$ make deps

# 启动服务
$ make start-background
server start for background

# 拜访测试
$ curl -i http://localhost:1024
HTTP/1.1 200 OK
Date: Wed, 14 Oct 2020 13:14:59 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Server: OpenResty

ok

# 进行服务
$ make quit
server quit

目录构造

├── Makefile        - makefile 脚本
├── README.md       - 阐明文档
├── conf            - nginx 配置
│   ├── common      - 公共配置
│   └── servers     - server 配置
├── logs            - 日志目录
├── rockspec        - 依赖治理
└── src             - lua 源码目录
    ├── app.lua
    └── core
正文完
 0