Created
November 12, 2016 10:53
-
-
Save dcalance/b872e28d493ac8d9f0e047f570463bde to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
"use strict"; | |
const express = require('express'), | |
app = express(), | |
config = require('./config'), | |
bodyParser = require('body-parser'), | |
assert = require('assert'), | |
mongoose = require('mongoose'), | |
imageInfoRoutes = require('./routes/ImageInfos'); | |
app.use(bodyParser.urlencoded({ | |
extended: false | |
})); | |
app.use(bodyParser.json()); | |
// app.use(express.static('public')); | |
// app.use(express.static('node_modules')); | |
mongoose.connect(config.database, (err) => { | |
assert.equal(null, err); | |
console.log('Successfuly connected to ' + config.database); | |
}); | |
app.use('/api/v1/imageInfo', imageInfoRoutes); | |
app.listen(config.port, () => { | |
console.log("Application is running on http://localhost:" + config.port + "/"); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment