Added recursive watch so web development is easier.

This commit is contained in:
Matt 2014-03-26 20:12:52 -06:00
parent 20ff126253
commit 631575ed7b
9 changed files with 51 additions and 33 deletions

6
coins/galleon.json Normal file
View File

@ -0,0 +1,6 @@
{
"name" : "Galleon",
"symbol" : "GLN",
"algorithm" : "keccak",
"txMessages" : false
}

View File

@ -1,6 +1,6 @@
{
"name" : "Helixcoin",
"symbol" : "HXC",
"algorithm" : "keccak",
"algorithm" : "max",
"txMessages" : false
}

View File

@ -1,6 +1,6 @@
{
"name" : "Wecoin",
"symbol" : "WEC",
"algorithm" : "keccak",
"algorithm" : "max",
"txMessages" : false
}

View File

@ -1,28 +1,3 @@
/* TODO
Need to condense the entire website into a single html page. Embedding the javascript and css is easy. For images,
hopefully we can only use svg which can be embedded - otherwise we can convert the image into a data-url that can
be embedded, Favicon can also be a data-url which some javascript kungfu can display in browser. I'm focusing on
this mainly to help mitigate ddos and other kinds of attacks - and to just have a badass blazing fast project.
Don't worry about doing any of that condensing yourself - go head and keep all the resources as separate files.
I will write a script for when the server starts to read all the files in the /website folder and minify and condense
it all together into one file, saved in memory. We will have 1 persistent condensed file that servers as our "template"
file that contains things like:
<div>Hashrate: {{=stats.hashrate}</div>
And then on some caching interval (maybe 5 seconds?) we will apply the template engine to generate the real html page
that we serve and hold in in memory - this is the file we serve to seo-bots (googlebot) and users when they first load
the page.
Once the user loads the page we will have server-side event source connected to the portal api where it receives
updated stats on some interval (probably 5 seconds like template cache updater) and applies the changes to the already
displayed page.
We will use fs.watch to detect changes to anything in the /website folder and update our stuff in memory.
*/
var fs = require('fs');
var path = require('path');
@ -31,6 +6,8 @@ var async = require('async');
var dot = require('dot');
var express = require('express');
var watch = require('node-watch');
var api = require('./api.js');
@ -101,8 +78,9 @@ module.exports = function(logger){
fs.watch('website', function(event, filename){
if (event === 'change' && filename in pageFiles)
watch('website', function(filename){
//if (event === 'change' && filename in pageFiles)
//READ ALL THE FILEZ BLAHHH
readPageFiles();
});

View File

@ -40,7 +40,8 @@
"async": "*",
"express": "*",
"dot": "*",
"colors": "*"
"colors": "*",
"node-watch": "*"
},
"engines": {
"node": ">=0.10"

View File

@ -0,0 +1,33 @@
{
"disabled": false,
"coin": "galleon.json",
"address": "GRAiuGCWLrL8Psdr6pkhLpxrQGHdYfrSEz",
"blockRefreshInterval": 1000,
"txRefreshInterval": 20000,
"connectionTimeout": 600,
"ports": {
"3537": {
"diff": 4
}
},
"daemons": [
{
"host": "localhost",
"port": 19632,
"user": "testuser",
"password": "testpass"
}
],
"p2p": {
"enabled": false,
"host": "localhost",
"port": 19333,
"protocolVersion": 70002,
"magic": "fcc1b7dc"
}
}

View File

@ -1,5 +1,5 @@
{
"disabled": false,
"disabled": true,
"coin": "helixcoin.json",
"address": "H9xyrh45LzLX4uXCP6jG6ZGrWho8srUgiG",

View File

@ -1,5 +1,5 @@
{
"disabled": true,
"disabled": false,
"coin": "litecoin.json",
"shareProcessing": {

View File

@ -1,5 +1,5 @@
<div>
To get started....
To get started simply....
</div>