Page 1 of 2

Love Web Server

Posted: Sat Jul 23, 2011 8:11 am
by schme16
Lately I've been wanting to use Lua more and more in other areas that I would normally use another language, one of the areas I wanted to use it in the MOST was in web development, I wanted SO BAD to use love instead of Ruby or PHP, and love felt like a great language for this as its fast and resource light.

My biggest disappointment was that the most of the protocols that supported lua were awkward in the implementation, feeling as though the creators of said methods weren't trying to use instead of PHP (etc.), instead they seemed more to be trying to turn lua into PHP (once again etc.).

I tried (with nearly no success) to use Xavante as it has built in lua support (being a pure Lua Web Server) but it was horrible to use and Mod_wombat (mod_lua) for apache is almost as bad.

So, disparaged with the current situation I decided to make my own Love Web Server (capitols for emphasis, :P).
Although still not finished, the server will start (port: 8080) will server html/htm/lp (lua page) files, images and octet-stream items

Features Currently:
  • Serves web pages and lua pages
  • Supports images, and many other media, also octect-stream
  • basic support for 404 errors, but not others yet
  • RUNS ON LOVE!
All thoughts/feature requests/code-corrections are welcome!
GitHub page: https://github.com/schme16/Love-Web-Server

Re: Love Web Server

Posted: Sat Jul 23, 2011 8:35 am
by Robin
I don't know why you would want that, since LÖVE isn't really what most people would want a web server to do. Although I guess it really doesn't have anything to do with LÖVE, since you can just as easily do:

Code: Select all

$ cat file.lua
require 'WebServer'
WebServer:run()
while true do
    WebServer:mainLoop()
end
$ lua file.lua
Oh, and the first line of main.lua should be:

Code: Select all

require 'WebServer'

Re: Love Web Server

Posted: Sat Jul 23, 2011 9:12 am
by Kadoba
Neat, but for this purpose what does LÖVE have over pure lua?

Re: Love Web Server

Posted: Sat Jul 23, 2011 9:48 am
by schme16
easily merged executable versus lua.exe+scripts
preexisting filesystem handler, rather than lua's standard io
loves pretty framework in general

I'm not necessarily saying that I think it should NOT be pure lua, just that LOVE is what I used to make the job easier.

Re: Love Web Server

Posted: Sat Jul 23, 2011 3:31 pm
by TechnoCat
Python is a really good webdev language.

Re: Love Web Server

Posted: Sun Jul 24, 2011 2:52 am
by schme16
I keep hearing that, but why not have the lua option?

Re: Love Web Server

Posted: Sun Jul 24, 2011 6:28 am
by TechnoCat
schme16 wrote:I keep hearing that, but why not have the lua option?
I made a website using only Lua once. It is an option as far as I know.
Just do CGI and use '#!/bin/lua' (or similar) at the top of your file.

Re: Love Web Server

Posted: Sun Jul 24, 2011 7:00 am
by BlackBulletIV
schme16 wrote:love felt like a great language for this as its fast and resource light.
You mean Lua. LOVE is basically an extension of Lua, or (more correctly), Lua is the interface to LOVE.

Re: Love Web Server

Posted: Sun Jul 24, 2011 12:18 pm
by Trappingnoobs
I guess I can't use this on 000webhost? :(

Re: Love Web Server

Posted: Sun Jul 24, 2011 3:30 pm
by thelinx
I sincerely doubt any free web hosting service would allow CGI.