Skip to content

Commit ded1852

Browse files
committed
change hashtag to history mode
Update README.md
1 parent d734981 commit ded1852

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,34 @@ You can simply build your own web pages, just following this instruction.
1717
## Build web pages
1818
1. Go into `web` folder.
1919
2. `npm install && npm run build`.
20-
2120
## That's all
22-
Now you can find all the files you need in the `web/dist` folder. Upload them to you server.
21+
Now you can find all the files you need in the `web/dist` folder. Upload them to you server, and configure your nginx server like this:
22+
23+
```
24+
server {
25+
listen 80 default_server;
26+
listen [::]:80 default_server;
27+
28+
root /your/root/path;
29+
30+
index index.html;
31+
32+
server_name example.com;
33+
34+
location / {
35+
try_files $uri $uri/ @rewrites;
36+
}
37+
38+
location @rewrites {
39+
rewrite ^(.+)$ /index.html last;
40+
}
41+
42+
}
43+
```
44+
45+
> Notice:
46+
47+
>If you want to deploy without nignx, you will need to change the router mode from `history` to `hash` [here](https://github.com/NyaaCat/NyaaStats/blob/713303de573ac36b9cd7ef8f20100aa3eb993273/web/src/router/index.js#L11). Remember to rebuild web pages.
2348
2449

2550
# Credits

nginx.conf.sample

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
server {
2+
listen 80 default_server;
3+
listen [::]:80 default_server;
4+
5+
root /your/root/path;
6+
7+
index index.html;
8+
9+
server_name example.com;
10+
11+
location / {
12+
try_files $uri $uri/ @rewrites;
13+
}
14+
15+
location @rewrites {
16+
rewrite ^(.+)$ /index.html last;
17+
}
18+
19+
}

web/src/components/Footer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
]),
2121
lastUpdate() {
2222
if (this.player && this.info) {
23-
return moment(this.player.lastUpdate || 0).format(this.info.timeFormat ? this.info.timeFormat.full : '');
23+
return moment(this.player.data.lastUpdate || 0).format(this.info.timeFormat ? this.info.timeFormat.full : '');
2424
} else if (this.info) {
2525
return moment(this.info.lastUpdate || 0).format(this.info.timeFormat ? this.info.timeFormat.full : '');
2626
}

web/src/components/PlayerPage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
<hr/>
4242

43-
<nyaa-footer></nyaa-footer>
43+
<nyaa-footer :player="player"></nyaa-footer>
4444
</div>
4545
</div>
4646
</template>

web/src/router/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Welcome from '../components/Welcome';
88
Vue.use(Router);
99

1010
export default new Router({
11+
mode: 'history',
1112
routes: [
1213
{
1314
path: '/',

0 commit comments

Comments
 (0)