Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Fixing path issues so this wirks on Azure
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
molant committed Aug 7, 2013
1 parent 48b5fec commit 1364d1d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/
/.idea/
/lib/cvlists.json
/lib/cvlists.json
cvlists.json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The report generation code and formatted pages from the modern.IE site are not i
Since the local scan generates JSON output, you can alternatively use it as a standalone scanner
or incorporate it into a project's build process by processing the JSON with a local script.

The main service for the scan is in the `lib/service.js` file; it acts as an HTTP server.
The main service for the scan is in the `app.js` file; it acts as an HTTP server.
It loads the contents of the web page and calls the individual tests, located in `/lib/checks/`.
Once all the checks have completed, it responds with a JSON object representing the results.

Expand All @@ -31,7 +31,7 @@ Once all the checks have completed, it responds with a JSON object representing
* Clone this repository.
* Install dependencies. From the Modern.ie subdirectory, type: `npm install`
* If desired, set an environment variable `PORT` to define the port the service will listen on. By default the port number is 1337. The Windows command to set the port to 8181 would be: `set PORT=8181`
* Start the scan service: From the Modern.ie subdirectory, type: `node lib/service.js` and the service should respond with a status message containing the port number it is using.
* Start the scan service: From the Modern.ie subdirectory, type: `node app.js` and the service should respond with a status message containing the port number it is using.
* Run a browser and go to the service's URL; assuming you are using the default port and are on the same computer, the URL would be: `http://localhost:1337/`
* Follow the instructions on the page.

Expand Down
8 changes: 4 additions & 4 deletions lib/service.js → app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ var url = require('url'),
cheerio = require('cheerio'),
promises = require('promised-io/promise'),
Deferred = require('promised-io').Deferred,
cssLoader = require('./checks/loadcss.js'),
jsLoader = require('./checks/loadjs.js'),
tests = require('./checks/loadchecks.js').tests,
cssLoader = require('./lib/checks/loadcss.js'),
jsLoader = require('./lib/checks/loadjs.js'),
tests = require('./lib/checks/loadchecks.js').tests,
http = require('http'),
path = require('path'),
zlib = require('zlib'),
Expand Down Expand Up @@ -96,7 +96,7 @@ function remoteErrorResponse(response, statusCode, message) {
}

function returnMainPage(req, response) {
fs.readFile(path.join(__dirname, "index.html"), function (err, data) {
fs.readFile(path.join(__dirname,"lib", "index.html"), function (err, data) {
if (!err) {
response.writeHeader(200, {"Content-Type": "text/html"});

Expand Down
1 change: 0 additions & 1 deletion cvlists.json

This file was deleted.

2 changes: 1 addition & 1 deletion test/auth_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

"use strict";

var service = require('../lib/service.js'),
var service = require('../service.js'),
serviceUrl = 'http://localhost:' + service.port + '/?url=%0',
authString = '&user=%1&password=%2',
authServer = require('../static/auth-server.js'),
Expand Down
4 changes: 2 additions & 2 deletions web.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="lib/service.js" verb="*" modules="iisnode"/>
<add name="iisnode" path="app.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<rule name="DynamicContent">
<match url="/*" />
<action type="Rewrite" url="lib/service.js"/>
<action type="Rewrite" url="app.js"/>
</rule>
</rules>
</rewrite>
Expand Down

0 comments on commit 1364d1d

Please sign in to comment.