Skip to content

Commit 060a7e7

Browse files
author
Guen Prawiroatmodjo
committed
test: set basePath
1 parent ec51920 commit 060a7e7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ const isProd = process.env.NODE_ENV === 'production'
22

33
module.exports = {
44
assetPrefix: isProd ? '/quantum-tracer/' : '',
5+
basePath: '/quantum-tracer'
56
};

Diff for: pages/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Layout, { siteTitle } from '../components/layout'
33
import utilStyles from '../styles/utils.module.css'
44
import {useState} from 'react';
55
import { useRouter } from 'next/router';
6+
import { basePath } from '../next.config';
67

78
export default function Home() {
89
const router = useRouter()
@@ -15,7 +16,7 @@ export default function Home() {
1516

1617
const parseGistUrl = preventDefault (() => {
1718
if (url != undefined) {
18-
router.push({pathname: "gist/" + url.replace("https://gist.github.com/", "")});
19+
router.push({pathname: basePath + "/../gist/" + url.replace("https://gist.github.com/", "")});
1920
}
2021
})
2122

0 commit comments

Comments
 (0)