Pgweb
Deployment
Step 1. Create a service
To deploy pgweb on Hostman, click Create in the top-left corner of your Dashboard and choose Back-end app.
Step 2. Connect the repository
In the window that appears next, click Connect another repository, choose the Public repository option and enter the link to the official pgweb repo: https://github.com/sosedoff/pgweb.git
Step 3. Choose a server
Pgweb must run on a specific cloud server. Choose the location and configuration of this server. You can upgrade it in the future.
Step 4. Configure the build settings
Next, the App customization window will appear.
First, select Go environment and then Another Go framework from the list of frameworks.
To deploy pgweb you can use either a build command or a bash script containing build commands.
Here’s an example of the build command:
go mod init github.com/sosedoff/pgweb.git && go mod vendor && go build -o ./app main.go
To use a bash script instead, you’ll need to enter the path to that script into the Build command field, for example:
./build.sh
The script would probably contain the following:
#!/usr/bin/env bash
go mod init github.com/sosedoff/pgweb.git
go mod vendor
go build -o ./app main.go
Here, ./app is the executable file compiled during build process, and main.go is the main file of your project.
By default, pgweb is running on localhost:8081. To change this setting, use the following Start command:
./app --listen 8080 --bind 0.0.0.0
Step 5. Deploy
Click Deploy to start the build process.
Once it starts, you will enter the deployment log. The log contains all the debugging data you'll need. If there are any issues with the code, you will get warning or error messages in the log, specifying the cause of the problem.
Usually it takes some time to install the cloud server during the first deployment.
When the deployment is complete, you will receive an e-mail notification and also see a similar log entry:
All done!
Your project is up and ready.