January 2, 2025
Jenkins vs GitHub Actions
I recently came across an interesting article by the team at Slack, where they share their experience migrating from Jenkins to GitHub Actions (GHA).
With Ngrok we can expose a locally running web server to the Internet. This can be useful for testing our projects on various devices such as mobile phones very easily before going to production.
Open a new terminal and run the following command:
npm i -g ngrok
Another alternative is to download ngrok from its website https://ngrok.com/download.
To use Ngrok, we need our project running on localhost. A simple way to do this is by using Python's SimpleHTTPServer module.
To use it, make sure Python is installed on your machine. If not, you can download it from the official website.
Once installed, open a terminal, navigate to the folder where the project is located, and run the following command:
python -m SimpleHTTPServer
python -m http.server
This will start a local server on port 8000 by default, accessible at http://localhost:8000. To change the port, simply specify it at the end of the command:
python -m http.server 4000
After following these steps, your project will be running on localhost.
It is recommended to create an account at https://ngrok.com before starting. While it is possible to use Ngrok without registering, not having an account comes with certain limitations, such as the duration of your URLs and more.
If you decide not to register, to get a new URL just run in the terminal:
ngrok http 8000
The final number depends on the port your project is running on locally.
If you have an account, you need to link it to your machine by entering the authentication token in the terminal. This token can be found in your user profile under the Your Authtoken section.
Enter the command provided by Ngrok in the terminal:
ngrok authtoken <your-auth-token>
After doing this, your account will be linked.
One of the extra features available when you have a Ngrok account is the ability to protect your URLs with a username and password. The command to do this is:
ngrok http -auth="username:password" 8080
For example:
ngrok http -auth="emi:239294sA" 3000
This is one of the many features Ngrok offers. For more information, check out the official documentation at https://ngrok.com/docs.