Love Web Server

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
schme16
Party member
Posts: 127
Joined: Thu Oct 02, 2008 2:46 am

Love Web Server

Post 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
My Development Diary - http://shanegadsby.info
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Love Web Server

Post 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'
Help us help you: attach a .love.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Love Web Server

Post by Kadoba »

Neat, but for this purpose what does LÖVE have over pure lua?
User avatar
schme16
Party member
Posts: 127
Joined: Thu Oct 02, 2008 2:46 am

Re: Love Web Server

Post 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.
My Development Diary - http://shanegadsby.info
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Love Web Server

Post by TechnoCat »

Python is a really good webdev language.
User avatar
schme16
Party member
Posts: 127
Joined: Thu Oct 02, 2008 2:46 am

Re: Love Web Server

Post by schme16 »

I keep hearing that, but why not have the lua option?
My Development Diary - http://shanegadsby.info
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Love Web Server

Post 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.
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Love Web Server

Post 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.
User avatar
Trappingnoobs
Citizen
Posts: 95
Joined: Tue Oct 12, 2010 8:52 pm

Re: Love Web Server

Post by Trappingnoobs »

I guess I can't use this on 000webhost? :(
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Love Web Server

Post by thelinx »

I sincerely doubt any free web hosting service would allow CGI.
Post Reply

Who is online

Users browsing this forum: No registered users and 22 guests