Skip to content

Node 6 support #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Logs
logs
*.log
*.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Deployed apps should consider commenting this line out:
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
node_modules

sftp-config.json

# Compiled results
client/js/templates.js
client/css/app.css

public/images
public/ical/ical.ics

# Don't send .md files to production env
*.md
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "0.10"
- "6"
services:
- mongodb
before_script:
Expand Down
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM mhart/alpine-node:6.9.5

LABEL Description="The awesome web app that supports awesome events" Vendor="SINFO" Version="0.0"

WORKDIR /usr/src/app

ENV NODE_ENV production

# Build the npm modules.
COPY package.json package.json

# We need to have native dependencies (e.g to install node-gyp)
RUN apk add --no-cache make gcc g++ python git bash

RUN npm install && \
npm cache clean && \
npm uninstall -g npm

# We don't need this anymore
RUN apk del git python g++ gcc make

# Add the remaining source (excluding `./node_modules` thanks to `.dockerignore`).
ADD . /usr/src/app

EXPOSE 8080

CMD [ "node", "server/index.js" ]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ The backend is based on hapi, and the frontend initially was Angular but we're r
### Installation:
1. Clone the repo: <code>git clone [email protected]:sinfo/eventdeck.git</code>
2. Enter the directory: <code>cd eventdeck</code>
3. Install the dependencies: <code>npm install</code> or <code>npm i</code>
3. Install the dependencies: <code>npm install</code> or <code>yarn</code>
4. Set the environment variables used on <code>config.js</code>
5. Start the server: <code>npm start</code>
5. Start the server: <code>npm start</code> or <code>yarn start</code>
15 changes: 8 additions & 7 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
var pack = require('./package')
var path = require('path')
var bunyanLogentries = require('bunyan-logentries')
const pack = require('./package')
const path = require('path')
const bunyanLogentries = require('bunyan-logentries')

var config = {
const config = {
url: process.env.EVENTDECK_URL || 'http://localhost:8080',
host: process.env.EVENTDECK_HOST || 'localhost',
port: process.env.EVENTDECK_PORT || 8080,
isDev: process.env.NODE_ENV !== 'production',
isSecure: process.env.EVENTDECK_IS_SECURE === true || process.env.EVENTDECK_IS_SECURE === 'true'
isDev: process.env.NODE_ENV !== 'production'
}

config.cannon = {
Expand Down Expand Up @@ -57,7 +56,9 @@ config.bunyan = {

config.swagger = {
pathPrefixSize: 2,
apiVersion: pack.version,
info: {
version: pack.version
},
basePath: config.url
}

Expand Down
77 changes: 38 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "eventdeck",
"version": "0.0.0",
"description": "eventdeck",
"main": "index.js",
"main": "server/index.js",
"engines": {
"node": ">=6.9.0"
},
"scripts": {
"start": "node server/index.js | bunyan",
"mon": "nodemon server/index.js --ignore client/ | bunyan",
Expand All @@ -14,8 +17,7 @@
"standard": {
"ignore": [
"client/js/templates.js",
"client/js/ink-all.js",
"server/scripts/*"
"client/js/ink-all.js"
]
},
"pre-commit": [
Expand All @@ -31,7 +33,8 @@
"João Antunes <[email protected]>",
"Diogo Pais <[email protected]>",
"Duarte Paiva <[email protected]>",
"Francisco Gonçalves <[email protected]>"
"Francisco Gonçalves <[email protected]>",
"Carlos Faria <[email protected]>"
],
"license": "MIT",
"bugs": {
Expand Down Expand Up @@ -66,53 +69,49 @@
"ampersand-view-switcher": "^1.1.2",
"andlog": "^1.0.0",
"async": "^0.2.10",
"boom": "^2.5.1",
"bows": "^1.3.2",
"cookie-getter": "0.0.2",
"boom": "^4.2.0",
"bows": "^1.6.0",
"bunyan": "^1.8.5",
"bunyan-logentries": "~1.0.0",
"cookie-getter": "1.0.1",
"cron": "~1.0.4",
"domify": "^1.3.0",
"domready": "^1.0.5",
"domify": "^1.4.0",
"domready": "^1.0.8",
"emailjs": "~0.3.8",
"favicon-setter": "^0.1.1",
"handlebars": "^2.0.0",
"hapi": "^7.5.3",
"hapi-auth-cookie": "^1.4.2",
"hapi-swagger": "^0.4.2",
"handlebars": "^4.0.0",
"hapi": "^16.1.0",
"hapi-auth-cookie": "^6.1.1",
"hapi-swagger": "^7.6.0",
"hoek": "^2.9.0",
"icalendar": "^0.7.1",
"joi": "^4.9.0",
"inert": "^4.1.0",
"joi": "^10.2.0",
"jquery": "^2.1.1",
"lout": "^5.1.2",
"lout": "^9.2.0",
"mailcomposer": "~0.2.12",
"mailgun": "^0.4.3",
"mailgun": "^0.5.0",
"markdown": "~0.5.0",
"marked": "^0.3.3",
"moment": "^2.8.4",
"mongoose": "^3.9.7",
"moonboots_hapi": "^3.0.2",
"pmx": "^0.3.20",
"marked": "^0.3.6",
"moment": "^2.17.1",
"mongoose": "^4.8.1",
"moonboots_hapi": "^4.0.0",
"rand-token": "~0.2.1",
"request": "^2.58.0",
"request": "^2.79.0",
"slug": "^0.7.1",
"socket.io": "^1.2.0",
"socket.io-client": "^1.2.0",
"stylizer": "^1.2.0",
"socket.io": "^1.7.2",
"socket.io-client": "^1.7.2",
"stylizer": "^2.1.0",
"templatizer": "^1.5.2",
"underscore": "^1.6.0"
"underscore": "^1.8.3",
"vision": "^4.1.1"
},
"devDependencies": {
"bunyan": "~1.2.1",
"bunyan-logentries": "~1.0.0",
"code": "~1.2.0",
"lab": "~5.0.1",
"nodemon": "^1.7.1",
"standard": "^7.1.2",
"pre-commit": "^1.1.3",
"snazzy": "^4.0.0"
},
"standard": {
"ignore": [
"/client/js/ink-all.js"
]
"code": "~4.0.0",
"lab": "^12.1.0",
"nodemon": "^1.11.0",
"pre-commit": "^1.2.2",
"snazzy": "^6.0.0",
"standard": "^8.6.0"
}
}
4 changes: 2 additions & 2 deletions server/db/access.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var mongoose = require('mongoose')
const mongoose = require('mongoose')

var schema = new mongoose.Schema({
let schema = new mongoose.Schema({
member: String,
thread: String,
last: Date
Expand Down
4 changes: 2 additions & 2 deletions server/db/chat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var mongoose = require('mongoose')
const mongoose = require('mongoose')

var schema = new mongoose.Schema({
const schema = new mongoose.Schema({
id: {type: String, unique: true},
name: String,
members: [String],
Expand Down
4 changes: 2 additions & 2 deletions server/db/comment.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var mongoose = require('mongoose')
const mongoose = require('mongoose')

var schema = new mongoose.Schema({
let schema = new mongoose.Schema({
thread: String,
subthread: String,
member: String,
Expand Down
12 changes: 6 additions & 6 deletions server/db/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
var mongoose = require('mongoose')
var mongoUrl = require('../../config').mongo.url
var log = require('../helpers/logger')
const mongoose = require('mongoose')
const mongoUrl = require('../../config').mongo.url
const log = require('../helpers/logger')

mongoose.connect(mongoUrl)
var db = mongoose.connection
const db = mongoose.connection

db.on('error', function (err) {
db.on('error', (err) => {
log.error('Connection error:', err)
})

db.once('open', function () {
db.once('open', () => {
log.info('Successfuly connected to mongoDB')
})

Expand Down
4 changes: 2 additions & 2 deletions server/db/member.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var mongoose = require('mongoose')
const mongoose = require('mongoose')

var schema = new mongoose.Schema({
const schema = new mongoose.Schema({
id: {type: String, unique: true},
name: String,
img: String,
Expand Down
4 changes: 2 additions & 2 deletions server/helpers/dupKeyParser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function (err) {
module.exports = (err) => {
// this example is showing how to get the field `email` out of the err message
var field = err.split('index: deck.')[1].split('.$')[1]
let field = err.split('index: deck.')[1].split('.$')[1]
// now we have `email_1 dup key`
field = field.split(' dup key')[0]
field = field.substring(0, field.lastIndexOf('_')) // returns email
Expand Down
Loading