/*
 *    Modules
 */

var express = require('express');
var Q = require('q');
var http = require('http');
var fs = require('fs');
//var powernode = require('./lib/powernode');

/*
 *    Configuration
 */

var config  = JSON.parse(fs.readFileSync('config.json'));
//var secrets = JSON.parse(fs.readFileSync('secrets.json'));
var version = JSON.parse(fs.readFileSync('package.json')).version;

//powernode.setAppString('CenterScout v' + version);

/*
 *    ExpressJS Setup
 */

// Create ExpressJS instance
var app = express();

// Default port is 8080
app.set('port', process.env.PORT || 8080);

// Define static/ folder
app.use(express.static('./static'));

// Middleware for POST requests
app.use(express.json());

/*
 *    API Endpoints
 */

var data = [
        {
            'name':  'Chapter 12 TEST',
            'class': 'M',
            'date':  '02/15',
            'percent': '98%',
            'fraction': '49/50'
        },
        {
            'name':  'Chapter 12 Homework',
            'class': 'M',
            'date':  '05/29',
            'percent': '100%',
            'fraction': '24/24'
        },
        {
            'name':  'Chapter 12.3 Quiz',
            'class': 'CAD',
            'date':  '05/30',
            'percent': '86%',
            'fraction': '26/30'
        }
    ];

// Get PowerSchool(R) data
app.get('/api/grades', function(req, res) {
    var username = req.body.username;
    var password = req.body.password;
    res.writeHead(200, { 'Content-Type': 'application/json' });
    // powernode
    //     .getStudentData('chsd115.lfschools.net', username, password)
    //     .then(JSON.stringify).then(res.end);
    res.end(JSON.stringify(data));
});

// Get assignments from www.lakeforestschools.org
app.get('/api/assignments', function(req, res) {

});

/*
 *    NodeJS Setup
 */

// Create and start HTTP server
// TODO: Use HTTPS http://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
http.createServer(app).listen(app.get('port'), function() {
    console.log('Server started.');
});

@@ -1191,11 +1191,9 @@
 ': '
-CAD
+M
 ',%0A 
@@ -1283,16 +1283,16 @@
 '26/30'%0A
-
         
@@ -1292,16 +1292,398 @@
        %7D
+,%0A        %7B%0A            'name':  'Phone Case Project',%0A            'class': 'CAD',%0A            'date':  '06/01',%0A            'percent': '100%25',%0A            'fraction': '30/30'%0A        %7D,%0A        %7B%0A            'name':  'Machine Vise Project',%0A            'class': 'CAD',%0A            'date':  '03/16',%0A            'percent': '100%25',%0A            'fraction': '30/30'%0A        %7D,%0A        
 %0A    %5D;%0A

Add more placeholder data