For an index to all my stories click this text
At the moment I am writing a lot of small Javascript programs. The reason is that I am heavily into PWA's. For those in the dark: A PWA is a program that runs on desktop computers (Windows, Linux and Apple) and also on tablets (Android and IOS) and mobile phones (Android and IOS). So you write one program and it runs on all systems !!! That saves a lot of developing time. Magic !!
Next to that you do not need a developer account (25USD once for Google and 99USD yearly for Apple), you do not need to publish through the app stores. And becoming a new developer with Google means you need to find 12 testers that test your app for 14 days !! Even better you do not need to comply to their rules !!!
PWA's means getting your freedom as a developer back !!!
The programming language for PWA's is Javascript.
Actually I am writing a book about this. If you are interested in a book on this subject drop me a note.
So I am writing a lot of small Javascript programs. And I want to test them.
Testing Javascript is actually easy. Just put it into an HTML file and open it in your browser. It will work immediately. And opening the developer console in your browser (More tools==>Web Developer Tools==>Console) you can even see what's wrong if there is a bug in your code.
Sidenote.
Javascript
is a fun language which is not very difficult to learn. And you get
instant results in your webbrowser. The language is useful for all kinds
of projects, including IOT projects of which you find several on this
weblog.
To make programming in Javascript easier I collected over 500
tips and tricks and bundled them in a book. The book is distributed
world-wide by amazon.com
Click here to learn more about this book or order it
And sometimes I want to test these programs running from a real webserver.
In 2024 I wrote a story on a small reaction game I developed. It is pure vanilla Javascript (no frameworks and no libraries) and works surprisingly well. The source code for the game is in the story. You can find it here:
https://lucstechblog.blogspot.com/2024/03/javascript-reaction-game.html
I used Github to store the html code and turn the Github repositry into a webpage. You can do the same. I have written how to do that in this story:
https://lucstechblog.blogspot.com/2023/07/using-github-for-building-website.html
But to do so the first step is to create a Github repository. Then upload your html code. And then turn that repository into a website. All in all this takes a bit of time. And in the end you have a lot of repositories that you might not need so you have to delete them all again.
And then I found an easy way to get a temporary website.
Netlify Drop
Netlify is a company that offers a lot of webservices. And one of these services is Netlify Drop.
You can use this for free and you even do not have to log in !!!!
Just put your HTML file with CSS and Javascript in a folder on your computer. I made a folder called React-game (while writing this story).
For those wondering: I am running Linux on my computer (actually a Raspberry Pi5) but don't worry this will work on Windows equally well !! And as I am not getting sponsored I do not have a Mac so I can not test that.
In that folder I put my reaction game HTML file. Do remember to rename the HTML file to index.html because every websites starting point is the file index.html.
Next open your webbrowser (I am using Firefox) and visit:
https://app.netlify.com/drop
Drag your folder with your test program to the webpage and you are done !!!
The folder is uploaded to Netlify and after a few seconds (depending on the size of your program and the number of files) the screen alters.
Your site is now alive. The name is at the top in a different color (green-blue) and in this example is:
https://dynamic-bunny-771e26.netlify.app
You can copy this name and put it in your browsers address bar. You can also just click on the name and the site will open.
The site is password protected. But in this case that is just a way to keep bots out cause the password for each site is the same: My-Drop-Site
The password was shown in the first screen where it mentioned that your site is alive !!
Just paste that name in and press the submit button and your site opens and can be tested.
Try it yourself.
Create a new folder on your computers storage.
Then copy the code from my reaction game from here:
https://lucstechblog.blogspot.com/2024/03/javascript-reaction-game.html
Or use your own HTML creation.
Just paste it in any editor and then save it as index.html in the just created folder.
Drag the folder to https://app.netlify.com/drop and you are off to the races.
Any Caveats ????
Well yes there are some things to consider.
First the name of your site is not something you will easily remember. In this example like you can see it is: https://dynamic-bunny-771e26.netlify.app/
So copy and store that name somewhere if you need to use it frequently.
And that is the other caveat: your site will only be available for one (1) hour.
Now one hour does not seem a lot, but remember that a single html file is loaded in the memory of your browser and will stay there operational until you close the browsers tab.
The sunny side
Your code will be removed after an hour. So anybody looking at this website now will get a page not found error or likewise. So your code is rather safe.,
You can use this many times a day for testing different websites. So you can test a lot, before making a real production site for it.
Long-time usage.
Sometimes a one hour test period is not enough.
If you need more just go to the Netlify webpage: https://www.netlify.com/
Sign up. Start a new project and dump your folder in it.
The, this way, created site will last for ever.
Netlify will grant you (at this moment) 300 credits per month for free. Each website you create this way will cost 15 credits. So effectively you can create 20 websites each month however........
Every GB of data that is transferred will cost you 10 credits. So if you have loads of people visiting your test-site that will cost a lot of credits. For small sites like my reaction game (which is only 1K) a GB will go a long way.
When you run out of credits your sites are put on hold till the next month.
Of course you can have paid subscriptions with a lot more credits.
Concluding
For quickly testing small websites this is a great solution.
The one hour limit is in my test phase not a problem and for some long time testing purposes I have made an account and applied some test sites that way.
The only reservation I have is that this is again a cloud based service and I have seen quite a few of these services suddenly limiting the free tier or stopping alltogether.
So to be really safe I am building my own webserver on a humble Raspberry Pi3. But that's for another story.
Till next time
have fun
Luc Volders
