We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5218cd commit 45fc26fCopy full SHA for 45fc26f
1 file changed
examples/404.js
@@ -0,0 +1,30 @@
1
+/**
2
+ *
3
+ * Install:
4
+ * npm install browser-sync
5
6
+ * Run:
7
+ * node <yourfile.js>
8
9
+ * This example will redirect all 404 requests to a
10
+ * custom 404.html page
11
12
+ */
13
+
14
+"use strict";
15
16
+var browserSync = require("browser-sync").create();
17
18
+browserSync.init({
19
+ files: ["app/css/*.css"],
20
+ server: {
21
+ baseDir: "app"
22
+ }
23
+}, function (err, bs) {
24
+ bs.addMiddleware("*", function (req, res) {
25
+ res.writeHead(302, {
26
+ "location": "404.html"
27
+ });
28
+ res.end('Redirecting!');
29
30
+});
0 commit comments