Skip to content

Instantly share code, notes, and snippets.

@dcalance
Created November 12, 2016 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcalance/b872e28d493ac8d9f0e047f570463bde to your computer and use it in GitHub Desktop.
Save dcalance/b872e28d493ac8d9f0e047f570463bde to your computer and use it in GitHub Desktop.
(() => {
"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