Clean up comments.
This commit is contained in:
		
							parent
							
								
									29d73bfc8d
								
							
						
					
					
						commit
						de40a4e042
					
				
							
								
								
									
										12
									
								
								server.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								server.js
									
									
									
									
									
								
							@ -15,26 +15,16 @@ app.engine('hbs', hbs.express4({
 | 
			
		||||
}));
 | 
			
		||||
app.set('view engine', 'hbs');
 | 
			
		||||
app.set('views', __dirname + '/views');
 | 
			
		||||
//app.use('/lib', express.static('lib')); // these 3 seem hacky, but doing it here instead of view.
 | 
			
		||||
//app.use('/keymap', express.static('keymap'));
 | 
			
		||||
//app.use('/mode', express.static('mode'));
 | 
			
		||||
app.use(express.static('codemirror'));
 | 
			
		||||
 | 
			
		||||
var notePath = __dirname + '/note-data/allNotes.txt';
 | 
			
		||||
 | 
			
		||||
app.get('/', function(req, res){
 | 
			
		||||
    winston.info("GET /");
 | 
			
		||||
    // Get curent text from allNotes.txt.
 | 
			
		||||
    // How to pass that text into index.html editor control??? Still need Handlebars???
 | 
			
		||||
    // i may be grokking it...need to keep handlebars, though.
 | 
			
		||||
    // read contents of allNotes.txt into a variable.
 | 
			
		||||
    // pass that variable as data to handlebars template, {{notetxt}}.
 | 
			
		||||
    // Get curent text from allNotes.txt and pass that data to handlebars template.
 | 
			
		||||
    fileSystem.readFile(notePath, {encoding: 'utf-8'}, function(err,data){
 | 
			
		||||
        if (!err){
 | 
			
		||||
            winston.info('successful file read');
 | 
			
		||||
            //response.writeHead(200, {'Content-Type': 'text/html'});
 | 
			
		||||
            //response.write(data);
 | 
			
		||||
            //response.end();
 | 
			
		||||
            res.render('index', {notetxt: data}, function(err, html) {
 | 
			
		||||
                if(err !== null) {
 | 
			
		||||
                    winston.error(err);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user