Skip to content

Commit b1cbe45

Browse files
author
John Doherty
committed
added notes on how to run the example included in the project
1 parent fc9a1e0 commit b1cbe45

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

README.MD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ The `$` passed to your transform method is a JQuery like object using [cheerio](
6969

7070
![alt text](docs/bbc-news-fake-homepage.png "BBC News actual homepage")
7171

72+
### Run the example
73+
74+
You can try the example for yourself using the following command:
75+
76+
```
77+
node ./node_modules/node-iframe-replacement/example/server.js
78+
```
79+
7280
## Auto base tag injection
7381

7482
To ensure the source scripts, styles and images load within your site a base tag is automatically injected ```<base href="http://www.bbc.co.uk/news" />```.

example/server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ function Server() {
3030
});
3131

3232
// start the server
33-
app.listen(8080);
33+
app.listen(8080, function(){
34+
console.log('Server running... Visit http://localhost:8080 in your browser');
35+
});
3436
}
3537

3638
module.exports = new Server();

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "NodeJS + Express replacement for the HTML iframe",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified yet!\" && exit 1"
7+
"example": "node example/server.js"
88
},
99
"repository": {
1010
"type": "git",
@@ -33,9 +33,7 @@
3333
"dependencies": {
3434
"cheerio": "^0.20.0",
3535
"node-cache": "^3.2.1",
36-
"request-promise": "^3.0.0"
37-
},
38-
"devDependencies": {
36+
"request-promise": "^3.0.0",
3937
"express": "^4.14.0",
4038
"express-handlebars": "^3.0.0"
4139
}

0 commit comments

Comments
 (0)