     console.log 'Start create articles'
     return
 
-if args.length < 2
-    console.log 'Fictitions should take 2 parameters'
-else
-    switch args[1]
-        when 'users' then createUsers()
-        when 'pages' then createPages()
-        when 'articles' then createArticles()
-
-#console.log simpleWord()
-
-###b = new bootstrap
+b = new bootstrap
 
 s = new server
 
 s.bootstrap(b).run (app, server) ->
-    console.log 'Connected to : ' + app.get 'port'###
+    console.log 'Connected to : ' + app.get 'port'
 
+    if args.length < 2
+        console.log 'Fictitions should take 2 parameters'
+    else
+        switch args[1]
+            when 'users' then createUsers(app)
+            when 'pages' then createPages(app)
+            when 'articles' then createArticles(app)
+    return
+

generateEmail = ->
    simpleWord() + '@' + simpleWord() + '.' + simpleWord(2)

createUsers = ->
    n = args[2] - 1
    console.log 'Start to create ' + n + ' users'

    while n > -1
        user = {

            password: simpleWord()
            status: 1
        }

        new user_model(user).save (e, u) ->
            if e isnt null
                app.get('logger').warn 'An user doesnot saved!', e
            else
                app.get('logger').info 'User saved!'
            return

        n--

    return
