在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):torhve/LuaWeb开源软件地址(OpenSource Url):https://github.com/torhve/LuaWeb开源编程语言(OpenSource Language):Lua 98.2%开源软件介绍(OpenSource Introduction):A Simple nameless blog engineMy motivation was just having a simple no frills blog for publishing some of my latest writings. This project is not very serious and is meant for personal use. The most unusual part about this project is it's usage of nginx as the "app server". This is possible using lua, since there is a nginx lua module that enables you to call lua from the nginx conf. Have a look at openresty's site for more about what it enables you to do. One of the coolest things about Lua is its speed, check out http://www.techempower.com/benchmarks/ The full stack: Components
Now we know the components in use, so now I can explain how they work togheter. Lua runs inside nginx and is being used as backend as it is being called in the web developer world. There is little to no javascript running in this setup. The backend loads a few templates (header, footer, etc) using Zed Shaw's tiny templating engine from another micro framework in Lua, check it out here: Tir Microframework The index template looks in the predefined git repository for a list for markdown files, these will be the blog posts, then it runs git log to figure out the date the blog post was created and displays a list. The blog post template extracts a filename from the URL and loads the corresponding Markdown file. The markdown gets compiled with Niklas Frykholm's Markdown parser written in lua. Each view has a simple counter in redis, with the primary motivation of showcasing the speed of these pages. The Redis database is not really needed for any functionality. Publishing a new article is then just the small matter of writing a Markdown file and pushing it to the blog repository and then it will display in the list and have its own permanent URL.
AuthorTor Hveem [email protected] License and CopyrightThis code is licensed under the BSD license. Copyright (C) 2013, by Tor Hveem [email protected] All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论