News for hackers. Stuff that matters.
Re:Spark web server by dangerlibrary on Wednesday February 12, 2014 @11:37AM (#7225269)
Is it really that hard to add 5 lines of boilerplate to your nginx conf? You can probably just copy-paste an existing server{} block or sites-available file and change the root directory. As a bonus, you'll learn a bit about how to configure the same tool you'll use later in production.

Oh. It's written in Go. Got it.

Re:Spark web server by sanderjd on Wednesday February 12, 2014 @12:08PM (#7225522)
I'm so sick of seeing this pattern of 1) person makes tool they find useful, 2) person releases tool publicly for free, 3) other person comes across tool but doesn't find it useful, 4) other person publicly denigrates tool as being universally not-useful.

I just don't get it.

Re:Spark web server by tzury on Wednesday February 12, 2014 @12:37PM (#7225792)
@dangerlibrary simply says: Do not re-invent the wheel. I cannot see any real-world production environment where this new server is better approach then activating a tiny config file. Thus, it is a very good lesson to the author: Use what is out there and build what is missing.
Re:Spark web server by sanderjd on Wednesday February 12, 2014 @01:04PM (#7226045)
I very rarely see a "hey I made this!" post here that doesn't include one or more comments along the lines of "this already exists!". I don't mind these sorts of comments when they tell me something I didn't know - "you can achieve something similar by doing coodle with well-known tool doodle!", "there is somewhat-obscure tool foodle that does exactly this!" - there are some comments like that in this thread. What I dislike is when these sorts of comments are along the lines of, "you should have just done the thing that you made the tool to avoid having to do!". It is just dismissal and leaves nobody the wiser.

It seems delusional to think that this sort of comment is somehow a good learning experience for a library author. Everyone knows that you shouldn't reinvent the wheel, but there are reasonable disagreements on what exactly that means.

Re:Spark web server by dangerlibrary on Wednesday February 12, 2014 @12:13PM (#7225551)
I don't think I said anything negative about the tool itself, or about the author of the tool, who seems perfectly happy with it.

You're right that I don't think it's useful to have a proliferation of tools that do one thing worse than a general-purpose tool.

I don't want an avocado peeler - I'll use a knife and I'll recommend using a knife to others.

Re:Spark web server by reeses on Wednesday February 12, 2014 @12:28PM (#7225700)
It's your tone more than anything. I read some of your previous posts to see if you were a d-bag and I came to the conclusion that you're not[1]. This reads more like the post was a button-pusher for you. I can relate. :)

Unfortunately, even with the tone removed, the comment hits that "top-voted middlebrow" button for many of the other people on the site. I would however say that for TFA itself as well.

[1] the opinion of some random interdweeb carries a lot of weight, I know. :)

Re:Spark web server by mverwijs on Wednesday February 12, 2014 @01:36PM (#7226264)
Great. Good for you.

Your initial comment, however, is filled with a denigrating tone. It is that tone your parent is addressing. Not so much the content. The tone. It is unkind.

Re:Spark web server by rif on Wednesday February 12, 2014 @11:44AM (#7225313)
Does nginx have a directive for serving this text quickliy:

<h1>Maintenance</h1><p>will be back soon!</p>

Oh. It's written in C. Got it.

Re:Spark web server by dangerlibrary on Wednesday February 12, 2014 @11:49AM (#7225350)
You still need to stop the existing web server to get spark to take over port 80, and restart it when you are done, so it's not quite that simple.

Also, it's not hard to keep a maintenance conf file around, pointing to a different directory. At least, it's certainly no harder than downloading a second web server. Then it's just "sudo ln /etc/sites-available/maintenance /etc/sites-enabled/conf"

Re:Spark web server by rif on Wednesday February 12, 2014 @11:52AM (#7225378)
You are so right, still I had a need for such a little tool and I don't regret any of it's 48 lines of code so far :)
Re:Spark web server by theonewolf on Wednesday February 12, 2014 @12:32PM (#7225732)
The way I'd do this is have front-end load balancers just re-direct to a nginx configured just for this purpose.
Re:Spark web server by dangayle on Wednesday February 12, 2014 @12:55PM (#7225951)
Yes it does, although not out of the box:

http://wiki.nginx.org/HttpEchoModule

Re:Spark web server by georgebashi on Wednesday February 12, 2014 @01:49PM (#7226382)
You don't actually need echo, you can use return from the rewrite module (which is compiled in by default).

    return 503 "<h1>Maintenance</h1><p>will be back soon!</p>";
Re:Spark web server by rif on Wednesday February 12, 2014 @01:53PM (#7226418)
lol, I love hackers :)
Re:Spark web server by dangayle on Wednesday February 12, 2014 @04:46PM (#7227573)
Oh yeah. That's rad.
Re:Spark web server by rif on Wednesday February 12, 2014 @01:20PM (#7226155)
:)
Re:Spark web server by a-nom-a-ly on Wednesday February 12, 2014 @02:27PM (#7226646)

    # pgrep nginx
    #