-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
52 lines (47 loc) · 1.26 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// /* eslint-disable no-console */
// const express = require('express');
//
// const app = express();
// app.use(express.json());
// const req = require('request');
//
// //app.use(express.static(`${__dirname}/public`));
// app.use(express.static(`${__dirname}/src`));
// app.use(express.static(`${__dirname}/static/dist`));
//
// /**
// * send get request for sw.js
// */
// app.get(/sw.js$/, (request, response) => {
// console.log("sw.js")
// response.sendFile(`${__dirname}/src/sw.js`);
// });
//
// /**
// * send get request
// */
// app.get(/.*$/, (request, response) => {
// // response.sendFile(__dirname+'/src/index.html');
// console.log("not sw.js")
//
// response.sendFile(`${__dirname}/static/dist/index.html`);
// });
//
// app.listen(80);
//мок SW
/* eslint-disable no-console */
const express = require('express');
const app = express();
app.use(express.json());
const req = require('request');
//app.use(express.static(`${__dirname}/public`));
// app.use(express.static(`${__dirname}/src`));
app.use(express.static(`${__dirname}/static/dist`));
/**
* send get request
*/
app.get(/.*$/, (request, response) => {
// response.sendFile(__dirname+'/src/index.html');
response.sendFile(`${__dirname}/static/dist/index.html`);
});
app.listen(3000);