Skip to content

Commit 3d5da90

Browse files
Read app base URL from env var (#165)
1 parent c3a3597 commit 3d5da90

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

‎.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ NODE_ENV=development
22

33
TELEGRAM_T_API_ID=
44
TELEGRAM_T_API_HASH=
5+
6+
BASE_URL=https://web.telegram.org/z/

‎src/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121

2222
<!-- Open Graph / Facebook -->
2323
<meta property="og:type" content="website">
24-
<meta property="og:url" content="https://web.telegram.org/z/">
24+
<meta property="og:url" content="<%= htmlWebpackPlugin.options.baseUrl %>">
2525
<meta property="og:title" content="<%= htmlWebpackPlugin.options.appName %>">
2626
<meta property="og:description" content="Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.">
2727
<meta property="og:image" content="./<%= htmlWebpackPlugin.options.mainIcon %>.png">
2828

2929
<!-- Twitter -->
3030
<meta property="twitter:card" content="summary_large_image">
31-
<meta property="twitter:url" content="https://web.telegram.org/z/">
31+
<meta property="twitter:url" content="<%= htmlWebpackPlugin.options.baseUrl %>">
3232
<meta property="twitter:title" content="<%= htmlWebpackPlugin.options.appName %>">
3333
<meta property="twitter:description" content="Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.">
3434
<meta property="twitter:image" content="./<%= htmlWebpackPlugin.options.mainIcon %>.png">
3535

36-
<link rel="canonical" href="https://web.telegram.org/z/" />
36+
<link rel="canonical" href="<%= htmlWebpackPlugin.options.baseUrl %>" />
3737
<link rel="apple-touch-icon" sizes="180x180" href="./<%= htmlWebpackPlugin.options.appleIcon %>.png">
3838
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
3939
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">

‎webpack.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ const {
2323

2424
dotenv.config();
2525

26+
const { BASE_URL = 'https://web.telegram.org/z/' } = process.env;
27+
2628
module.exports = (_env, { mode = 'production' }) => {
2729
return {
2830
mode,
@@ -145,6 +147,7 @@ module.exports = (_env, { mode = 'production' }) => {
145147
appleIcon: APP_ENV === 'production' ? 'apple-touch-icon' : 'apple-touch-icon-dev',
146148
mainIcon: APP_ENV === 'production' ? 'icon-192x192' : 'icon-dev-192x192',
147149
manifest: APP_ENV === 'production' ? 'site.webmanifest' : 'site_dev.webmanifest',
150+
baseUrl: BASE_URL,
148151
template: 'src/index.html',
149152
}),
150153
new MiniCssExtractPlugin({

0 commit comments

Comments
 (0)