File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ import { readFileSync } from 'node:fs' ;
2+
13import gulp from 'gulp' ;
24import plumber from 'gulp-plumber' ;
35import { nunjucksCompile } from 'gulp-nunjucks' ;
@@ -137,6 +139,11 @@ export function startServer () {
137139 cors : true ,
138140 notify : false ,
139141 ui : false ,
142+ } , ( err , bs ) => {
143+ bs . addMiddleware ( '*' , ( req , res ) => {
144+ res . write ( readFileSync ( `${ PATH_TO_DIST } 404.html` ) ) ;
145+ res . end ( ) ;
146+ } ) ;
140147 } ) ;
141148
142149 watch ( `${ PATH_TO_SOURCE } **/*.{html,njk}` , series ( processMarkup ) ) ;
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html class ="page " lang ="ru ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < title > 404</ title >
6+ < meta name ="viewport " content ="width=device-width,initial-scale=1 ">
7+ < link rel ="stylesheet " href ="styles/styles.css ">
8+ < script src ="scripts/index.js " defer > </ script >
9+ </ head >
10+ < body class ="page__body ">
11+ < h1 > 404</ h1 >
12+ < p > Страница не найдена. < a href ="/ "> Перейти на главную</ a > .</ p >
13+ </ body >
14+ </ html >
You can’t perform that action at this time.
0 commit comments