Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidJDJ committed Oct 3, 2015
1 parent 4e0e421 commit 1dab2bd
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 0 deletions.
19 changes: 19 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html ng-app=''>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular-route.min.js"></script>
<script>

</script>
</head>
<body>
<div ng-view="">
</div>
</body>
</html>
12 changes: 12 additions & 0 deletions config/mongoose.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var mongoose = require('mongoose');
var fs = require('fs');

mongoose.connect('mongodb://localhost/saburiKonnect');

var modelsPath = __dirname + '/../server/models';

fs.readdirSync(modelsPath).forEach(function(file){
if (file.indexOf('.js') > 0){
require(modelsPath + '/' + file);
}
});
7 changes: 7 additions & 0 deletions config/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var Controller = require('./../server/controllers/controller.js');

module.exports = function(app){
app.post('/user/show', function(req, res){
Controller.show(req, res);
})
}
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "saburiKonnect",
"version": "0.0.1",
"dependencies": {
"body-parser": "latest",
"express": "^4.10.0",
"mongoose": "^4.0.1",
}
}
17 changes: 17 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var express = require('express');
var app = express();
var path = require('path');
var bodyParser = require('body-parser');

app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
app.use(express.static(path.join(__dirname, './client')));

// require('./config/mongoose.js');
// require('./config/routes.js')(app);

app.listen(8000, function(){
console.log('listening on port 8000');
})
9 changes: 9 additions & 0 deletions server/controllers/controlller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var mongoose = require('mongoose');
// var Model = mongoose.Model('Model')

module.exports = (function(){
return {
add: function(req, res){
//code
}
})();
10 changes: 10 additions & 0 deletions server/models/model.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var mongoose = require('mongoose');

var modelSchema = new mongoose.Schema({
title: String,
description: String,
name: String,
checked: {type: Boolean, default: false}
});

mongoose.model('Model', modelSchema);

0 comments on commit 1dab2bd

Please sign in to comment.