DEV Community

loading...

Today I woke up early to develop.

ffmaer profile image Tengchao Zhou ・2 min read

Alt Text

Today I woke up early to develop.

I ran into a problem because I can't get Heroku CLI working due to proxy issues. I decided to try Glitch.

However, pushing to Glitch is not the easiest thing. If you develop locally, one way to push to Glitch is through Github. However, if you use SQLite locally, there isn't a direct way to sync your local database with the database on Glitch. You have to use some tricks to go around. In this case, you have to upload the database separately from other code as a static asset to your Glitch project. And you use wget in the Glitch project's terminal to put that database file into the correct folder. And you need to write some code to help the server to find the database file in different places in different environments (i.e. local v.s. Glitch).

The task was to merge my Express backend with the React front end. I did not know how I can achieve that. But it turns out to be quite easy. All you need to do is to use npm run build to build the React app and then move the output to the server app's folder and let the server app serve the front end app as static files.

I did all these development on my Windows machine. It's far from a happy business to adapt to PowerShell or cmd as someone who's more familiar with Linux bash. Even though both PowerShell and cmd belong uniquely to Windows, they have different ways to set environment variables. And they have different ways to combine several shell commands. I really don't enjoy the variances.

2020.11.8

Discussion (0)

pic
Editor guide