diff --git a/app.js b/app.js index 130c64d..aa431ab 100644 --- a/app.js +++ b/app.js @@ -20,6 +20,7 @@ app.use(bodyParser.json()); // Routes app.use('/', require('./routes/users.js')); app.use('/', require('./routes/admin.js')); +app.use('/', require('./routes/3dprint.js')); app.use(function (req, res) { res.sendFile(__dirname + '/Public/index.html'); diff --git a/models/3dprint.js b/models/3dprint.js new file mode 100644 index 0000000..0a1ac66 --- /dev/null +++ b/models/3dprint.js @@ -0,0 +1,25 @@ +var autoIncrement = require('mongoose-auto-increment'); +var mongoose = require('mongoose'); +var Schema = mongoose.Schema; +var config = require('../config/config.js') + +var cnx = mongoose.createConnection("mongodb://localhost/ageg"); +autoIncrement.initialize(cnx); + +var PrintSchema = new Schema({ + cip: { type: String, required: true}, + job: { + [ + { + fileName: { type: String, required: true}, + picName: {type: String, required: true} + } + ] + }, + price: Number, + sDate: Date, + status: Number, + weight: Number +}); + +mongoose.model('Print', PrintSchema); \ No newline at end of file diff --git a/public/index.html b/public/index.html index aa4fa1f..c61f5b3 100644 --- a/public/index.html +++ b/public/index.html @@ -24,15 +24,7 @@