Closed jaromil closed 9 years ago
Do you mean http://mongoosejs.com/?
If yes, I suggest we leave such a decision to a later time, because it's just about a splash page now, and I do not want to think about having any dependency on NodeJS.
oh no. I meant https://github.com/cesanta/mongoose wich is a minimalist pure-C server.
NodeJS?! ahahahah c'mon you know me.... if I ever flip and start proposing nodejs you know what to do. You are being way too polite right now.
Phew, yeah, I was surprised :) Hmmm, Mongoose is GPLv2, but it does not say "or later", which makes it incompatible with GPLv3 or the AGPL.
I was thinking of using something like http://zshwiki.org/home/code/scripts/zshttpd
Also it mentions that Cesanta software "offers a full, royalty-free commercial license and professional support without any of the GPL restrictions." To me that sounds like people who mistake freedom for a restriction, and abuse for freedom.
GPLv2 incompatible with v3?! zshttpd never worked for me. There is the one I've written myself in Awk, but mongoose can do much better than that. FWIW we can simply use any http server supporting a cgi, let's simply do that.
May I ask what's the problem with node.js? It works fine on embedded devices and I think that would make things easier. Given the fact that the server will soon be something more than a simple application to serve a splash page, isn't it better to start off with something like node.js in the first place? That would definitely ease the development process. I totally understand that you're trying to keep things minimal, and at this stage even something like ngincat would be sufficient. But as things get more complex, you will need to deal with more problems and limitations.
well, I see nodejs runs on rpi and seems to do that well. I will not turn down any development in that direction if it happens and, at this point, would be nice to have some starting. To have some graphical layer at least i.e. to start showing the dowse status output and other monitoring activities. And to start thinkering around the way to build interaction (hellekin's idea of bubbles?) and such.
I have done zero progress on my mongoose (C) plan so far so I cannot hold anything at the moment.
It seems that in a way or another dowse should expose an API via websocket and json, this way anything will work really.
to answer your question, the problem is mostly that we are old-school oriented and see nodejs stuff as bloat. but since this is still a proof-of-concept eventually turning into a prototype then... lets go fwd with what we have. I have colleagues in other projects working with nodejs and the results look very good. Its just not my style (I usually stick to C/C++) nor hellekin's (he is a ruby guy, ahah!)
This is only the HTML/CSS part. Not the server part. Try this to test on localhost with nginx:
echo "127.0.4.1 www.dowse" | sudo tee -a /etc/hosts
cat | sudo tee /etc/nginx/sites-available/www.dowse <<EOD
#
## www.dowse
#
server {
listen 127.0.4.1:80;
server_name www.dowse;
root /srv/www/dowse;
index index.html;
try_files $uri $uri.html $uri/;
}
EOD
sudo ln -s /etc/nginx/sites-available/www.dowse /etc/nginx/sites-enabled
sudo ln -s ~/src/dyne/dowse/www /srv/www/dowse
sudo service nginx reload
Starting from commit 55fc249deccd9 I've introduced Consul.io to Dowse, now providing real-time service monitoring and interactive overview of all key/value storage.
Even in this early stage of development, Dowse should serve some kind of information on port 80 in order to signal it is running. This can be a start for the web-based interaction framework, keeping it minimal enough of course. I plan to use mongoose.