Skip to content

Commit

Permalink
Merge pull request #2 from cs673-team-silver-serpent/feature/login-page
Browse files Browse the repository at this point in the history
Feature/login page
  • Loading branch information
Andy O'Connell committed Feb 24, 2018
2 parents ace5fc7 + 02370e3 commit 48f346d
Show file tree
Hide file tree
Showing 33 changed files with 10,191 additions and 512 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ app.use(bodyParser.json());
// declare public folder
app.use(express.static(path.join(__dirname,'public')));

// routes

// routes
// for testing purposes during setup
app.get('/hello', (req,res) => {
res.send("Hello, world!");
Expand Down
20 changes: 11 additions & 9 deletions controllers/portal-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ const express = require('express');
const router = express.Router();
const project = require('../models/portal-model');



// GET HTTP method to /
router.get('/',(request,response) => {
// response.send("GET");
project.getAllProjects( (error,projects) => {
if (error) {
response.json({success:false,message:`Failed to load all projects. Error: ${error}`});
} else {
response.write(JSON.stringify({success:true, projects:projects},null,2));
response.end();
}
});
// response.send("GET");
project.getAllProjects( (error,projects) => {
if (error) {
response.json({success:false,message:`Failed to load all projects. Error: ${error}`});
} else {
response.write(JSON.stringify({success:true, projects:projects}, null, 2));
response.end();
}
});
});

// POST HTTP method to /
Expand Down
Loading

0 comments on commit 48f346d

Please sign in to comment.