Added different statuscodes & dev server
This commit is contained in:
parent
03ccb2f154
commit
b1df716e69
|
@ -18,8 +18,17 @@ Examples:
|
||||||
## Or install the browser client
|
## Or install the browser client
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Equivalent to: npm build
|
||||||
npm install
|
npm install
|
||||||
browserify lib/validator.js -o public/js/ttl.js
|
browserify lib/validator.js -o public/js/ttl.js
|
||||||
```
|
```
|
||||||
|
|
||||||
Then use it in your browser using the index.html in the public folder.
|
Then use it in your browser using the index.html in the public folder.
|
||||||
|
You can run this locally as follows.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Equivalent to: npm start
|
||||||
|
npm install
|
||||||
|
browserify lib/validator.js -o public/js/ttl.js
|
||||||
|
ws
|
||||||
|
```
|
||||||
|
|
|
@ -45,6 +45,7 @@ function validateArgument(arg) {
|
||||||
validate(res, showValidation);
|
validate(res, showValidation);
|
||||||
}).on('error', function (e) {
|
}).on('error', function (e) {
|
||||||
console.log("Got error: " + e.message);
|
console.log("Got error: " + e.message);
|
||||||
|
process.exit(1);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case null:
|
case null:
|
||||||
|
@ -52,6 +53,7 @@ function validateArgument(arg) {
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log('Cannot access %s: "%s" not supported', parsedUrl.href, parsedUrl.protocol)
|
console.log('Cannot access %s: "%s" not supported', parsedUrl.href, parsedUrl.protocol)
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,4 +66,5 @@ function showValidation(feedback) {
|
||||||
console.log('WARNING: ' + warning);
|
console.log('WARNING: ' + warning);
|
||||||
});
|
});
|
||||||
console.log("Validator finished with " + feedback.warnings.length + " warnings and " + feedback.errors.length + " errors.");
|
console.log("Validator finished with " + feedback.warnings.length + " warnings and " + feedback.errors.length + " errors.");
|
||||||
|
process.exit(feedback.errors.length > 0 ? 2 : 0);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -9,13 +9,17 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"n3": "1.0.0-beta.1"
|
"n3": "1.0.0-beta.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {
|
||||||
|
"browserify": "^16.2.3",
|
||||||
|
"local-web-server": "^2.6.1"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.0"
|
"node": ">=4.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "browserify lib/validator.js -o public/js/ttl.js",
|
"build": "browserify lib/validator.js -o public/js/ttl.js",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"start": "npm install && npm build && ws"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
4005
public/js/ttl.js
4005
public/js/ttl.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue