Ind.ie is now Small Technology Foundation.
Commit 6ea809a0 authored by ekaitz's avatar ekaitz

Fix requires:

    - Clean unneeded .coffee extension
    - Require package.json instead of reading it from the file directly.
parent 03c62229
......@@ -9,15 +9,10 @@
################################################################################
fs = require 'fs'
exports.route = (request, response) ->
# Get the version to display in the index page.
fs.readFile __dirname + '/../package.json', 'utf-8', (error, data) ->
if error
throw new Error(error)
packageJSON = JSON.parse(data)
version = packageJSON['version']
meta = require('../package.json')
version = meta.version
response.render 'main', {version: version}
\ No newline at end of file
response.render 'main', {version: version}
......@@ -11,7 +11,7 @@
################################################################################
superagent = require 'superagent'
timer = require '../lib/timer.coffee'
timer = require '../lib/timer'
exports.route = (request, response) ->
......
......@@ -12,21 +12,21 @@
express = require 'express'
set = require './lib/set-express.coffee'
set = require './lib/set-express'
superagent = require 'superagent'
# Helper: create a route from a route name (e.g., /simple -> /routes/simple.coffee)
createRoute = (routeName) ->
path = if routeName == '/' then 'main' else routeName[1..]
route = require('./routes/' + path + '.coffee').route
route = require('./routes/' + path).route
app.get routeName, route
#
# Set up Express with Set as the templating engine.
#
app = express()
app.engine 'html', (require './lib/set-express.coffee').__express
app.engine 'html', (require './lib/set-express').__express
app.set 'view engine', 'html'
app.set 'views', __dirname + '/views'
app.use express.static('views')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment