Restrudturing app + ES6 + Init socket + Init models

This commit is contained in:
Bruno SIMON
2016-06-02 19:49:00 +02:00
parent 5697cf1b8e
commit 0c2955c01b
9 changed files with 474 additions and 71 deletions
+38
View File
@@ -0,0 +1,38 @@
'use strict'
let Project = require( './project.class.js' )
class Projects
{
constructor()
{
this.all = {}
}
create_project( _slug )
{
// Create project
let project = new Project( _slug )
// Save
this.all[ project.slug ] = project
// Return
return project
}
get_project_by_slug( _slug )
{
// Find project
let project = this.all[ _slug ]
// Found
if( project )
return project
// Not found
return false
}
}
module.exports = Projects