Unverified Commit 235cbae8 authored by Mark Stenglein's avatar Mark Stenglein
Browse files

begin adding object models into the system

parent e4fc0783
......@@ -12,6 +12,7 @@ var path = require('path');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var Sequelize = require('sequelize');
// Load site wide configurations
var config = require('./config');
......
// Included as an example model temporarilly
// grab the things we need
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// create a schema
var userSchema = new Schema({
name: String,
username: { type: String, required: true, unique: true },
password: { type: String, required: true },
admin: Boolean,
location: String,
meta: {
age: Number,
website: String
},
created_at: Date,
updated_at: Date
});
// the schema is useless so far
// we need to create a model using it
var User = mongoose.model('User', userSchema);
// make this available to our users in our Node applications
module.exports = User;
cd schedules
echo "** Your sudo privalleges are needed to start the database, MongoDB"
sudo systemctl start mongod
echo "** visit localhost:3000 for the server"
DEBUG=myapp:* nodemon start
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment