Skip to content

Commit

Permalink
Actualize the template
Browse files Browse the repository at this point in the history
  • Loading branch information
heyqbnk committed Jul 16, 2024
1 parent 4d8cee5 commit 78dca3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 31 deletions.
42 changes: 14 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,18 @@ npm run dev
After this, you will see a similar message in your terminal:

```bash
VITE ready in 275 ms
VITE v5.2.12 ready in 237 ms

➜ Local: http://localhost:5173/solidjs-js-template
➜ Local: http://localhost:5173/solidjs-template
➜ Network: http://172.18.16.1:5173/solidjs-template
➜ Network: http://172.19.32.1:5173/solidjs-template
➜ Network: http://192.168.0.171:5173/solidjs-template
➜ press h + enter to show help
```

Here, you can see the `Local` link, available locally, and `Network` links accessible to all
devices in the same network with the current device.

To view the application, you need to open the `Local`
link (`http://localhost:5173/solidjs-js-template` in this example) in your browser.

Expand Down Expand Up @@ -95,9 +101,12 @@ which browsers will recognize as unsafe, resulting in a warning when accessing t
After uncommenting the function, run the `dev` script again and observe the output in your terminal:

```bash
VITE ready in 331 ms
VITE v5.2.12 ready in 265 ms

➜ Local: https://localhost:5173/solidjs-js-template
➜ Local: https://localhost:5173/solidjs-template
➜ Network: https://172.18.16.1:5173/solidjs-template
➜ Network: https://172.19.32.1:5173/solidjs-template
➜ Network: https://192.168.0.171:5173/solidjs-template
➜ press h + enter to show help
```

Expand All @@ -109,34 +118,11 @@ browser, you will see the following warning:
This browser warning is normal and can be safely ignored as long as the site is secure. Click
the `Proceed to localhost (unsafe)` button to continue and view the application.

Once the application is displayed correctly, submit this link as the Mini App link
Once the application is displayed correctly, submit one of the `Network` links as the Mini App link
to [@BotFather](https://t.me/botfather). Then, navigate
to [https://web.telegram.org/k/](https://web.telegram.org/k/), find your bot, and launch the
Telegram Mini App. This approach provides the full development experience.

### Expose Dev Server

Sometimes, you might want to view the application on other devices.

To expose your development server to local network devices, go to the `vite.config.js` file and
uncomment the line defining the `host` option.

Alternatively, you can achieve this by running the command `vite --host`.

Here is an example of the output you will see:

```bash
VITE v5.2.12 ready in 257 ms

➜ Local: https://localhost:5173/solidjs-js-template
➜ Network: https://172.27.224.1:5173/solidjs-js-template
➜ Network: https://172.19.32.1:5173/solidjs-js-template
➜ Network: https://192.168.0.171:5173/solidjs-js-template
```

All `Network` links listed here are accessible to devices on the same network. Using these links,
those devices will be able to view the application.

> **Important**
>
> Because we are using self-signed SSL certificates, the Android and iOS Telegram applications will
Expand Down
5 changes: 2 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ export default defineConfig({
},
publicDir: './public',
server: {
// Uncomment this line if you want to expose your dev server and access it from the devices
// in the same network.
// host: true,
// Exposes your dev server and makes it accessible for the devices in the same network.
host: true,
},
resolve: {
alias: {
Expand Down

0 comments on commit 78dca3d

Please sign in to comment.