Skip to content

Commit e70f24c

Browse files
committed
URL -> process.env.baseUrl
1 parent 9d4910c commit e70f24c

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

components/CustomHead.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import Head from 'next/head';
22
import React from 'react';
33

4-
import { URL } from '../utils/cangeURL';
5-
64
type Props = {
75
title: string;
86
postId: number;
@@ -18,7 +16,10 @@ const CustomHead: React.FC<Props> = (props) => {
1816

1917
<meta property="og:title" content="OmnisCode" />
2018
<meta property="og:type" content="website" />
21-
<meta property="og:url" content={URL + '/post/' + props.postId} />
19+
<meta
20+
property="og:url"
21+
content={process.env.baseUrl + '/post/' + props.postId}
22+
/>
2223
<meta property="og:image" content={props.image} />
2324
<meta property="og:site_name" content="OmnisCode" />
2425
<meta property="og:description" content={props.title} />

components/DefaultHead.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import Head from 'next/head';
22
import React from 'react';
33

4-
import { URL } from '../utils/cangeURL';
5-
64
type Props = {
75
pageName: string;
86
};
@@ -15,8 +13,10 @@ const DefaultHead: React.FC<Props> = (props) => {
1513
<link rel="icon" href="/favicon.ico" />
1614
<meta property="og:title" content="OmnisCode" />
1715
<meta property="og:type" content="website" />
18-
{/* URL = https://omniscode.one */}
19-
<meta property="og:url" content={URL + '/' + props.pageName} />
16+
<meta
17+
property="og:url"
18+
content={process.env.baseUrl + '/' + props.pageName}
19+
/>
2020
<meta
2121
property="og:image"
2222
content="https://omniscode-og-image.vercel.app/package%20main%0A%0Aimport%20%22fmt%22%0A%0Afunc%20main()%20%7B%0A%20%20%20%20fmt.Println(%22hello%20world%22)%0A%7D.jpeg?theme=gradient-dark&lang=go"

next.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const dev = process.env.NODE_ENV !== "production";
33
module.exports = {
44
env: {
55
baseUrl: dev
6-
? 'http://localhost:3000/api/v1'
7-
: 'https://omniscode.one/api/v1',
6+
? 'http://localhost:3000'
7+
: 'https://omniscode.one',
88
},
99
};

utils/axios.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios from 'axios';
22

33
const myAxios = axios.create({
4-
baseURL: process.env.baseUrl ?? 'http://localhost:3000/api/v1',
4+
baseURL: (process.env.baseUrl ?? 'http://localhost:3000') + '/api/v1',
55
});
66

77
export default myAxios;

utils/cangeURL.ts

-2
This file was deleted.

0 commit comments

Comments
 (0)