Skip to content
Snippets Groups Projects
Commit e539b0d1 authored by Markus Grigull's avatar Markus Grigull
Browse files

Initial NodeJS commit

parents
No related branches found
No related tags found
No related merge requests found
# NodeJS
node_modules/
# OS X
.DS_Store
FROM node:argon
# Bundle app source
COPY . .
# Install dependencies
RUN npm install
# Run the app
EXPOSE 3000
CMD [ "npm", "start" ]
# VILLASweb-backend
## Description
This is the backend for the VILLASweb frontend. It is build upon NodeJS, Express and MongoDB.
module.exports = {
'databaseName': 'VILLAS',
'databaseURL': 'mongodb://mongo:27017/',
'port': 3000
}
node:
image: acs/villasweb-backend
ports:
- "3000:3000"
links:
- mongo
mongo:
image: mongo
{
"name": "VILLASweb-backend",
"version": "0.1.0",
"private": true,
"main": "server.js",
"dependencies": {
"mongoose": "^4.5.1"
}
}
// include modules
var express = require('express');
var mongoose = require('mongoose');
// local include
var config = require('./config');
// create application
var app = express();
// connect to database
mongoose.connect(config.databaseURL + config.databaseName);
// start the app
app.listen(config.port, function() {
console.log('Express server listening on port ' + config.port);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment