Skip to content

Commit 011fa23

Browse files
committed
Library POSTs to /accesslint in host app.
- Setup test app to load library and receive requests - remove javascript and coffeescript from hound. Hound is not happy with ES2015
1 parent 1ca9e4c commit 011fa23

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
build/*
3+
test/public/build*

.hound.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +0,0 @@
1-
coffee_script:
2-
enabled: true
3-
4-
java_script:
5-
enabled: true

gulpfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ function compile(watch) {
1717
.pipe(buffer())
1818
.pipe(sourcemaps.init({ loadMaps: true }))
1919
.pipe(sourcemaps.write("./"))
20-
.pipe(gulp.dest("./build"));
20+
.pipe(gulp.dest("./build"))
21+
.pipe(gulp.dest("./test/public"));
2122
}
2223

2324
if (watch) {

src/logger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import request from "request";
22

33
export default function (message) {
4-
request.post("http://localhost:3000", message)
4+
request.post(`${window.location}accesslint`, message)
55
}

test/app.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
var express = require("express");
2-
var cors = require("cors");
32
var app = express();
43

5-
app.post("/", cors(), function(req, res) {
4+
app.use(express.static(__dirname + "/public"));
5+
6+
app.get("/", function(req, res) {
7+
res.send("index.html");
8+
});
9+
10+
app.post("/accesslint", function(req, res) {
611
res.send("Success!");
712
});
813

test/public/image.jpg

Loading

test/index.html renamed to test/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<html>
22
<head>
3-
<script src="../build/build.js"></script>
3+
<script src="build.js"></script>
44
</head>
55
<body>
66
<img src="image.jpg" />

0 commit comments

Comments
 (0)