Skip to content

jorgecortesdev/offline-website-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This repository is just an example on how to make a website works without an internet connection.

Example

To see this code in action go to: https://jorgecortesdev.github.io/offline-website-example/

Run the example locally

It could be many ways of doing it but this is a quick start.

Install dependencies, only if you don't have it installed already.

npm install -g http-server

Now you can run a local web server in the root of the project.

http-server

Now open you browser and go to: http://127.0.0.1:8080.

IMPORTANT: In order to emulate that you are offline, just stop the server with ctr+c.

Share with other devices

If you want to make it available for other devices like a tablet, smart phone or even internet you can use ngrok.

First download ngrok from: https://ngrok.com/download. Follow in page instructions to complete installation.

After that you can just run:

ngrok http 8080

It will give you a URL like: https://5d27d9945805.ngrok.io. That URL will be available to the world.