Skip to article frontmatterSkip to article content
tools = require('../js/tools'); tools.init()
Loading...

what is surge ?

surge lets you deploy your static website in 6 keystrokes; that’s how their pitch has it, and it’s mostly true !

in a nutshell, surge is a CDN (Content Delivery Network) that offers free static web hosting

take a look at https://surge.sh for more details

requirements: npx

just like with vite, you can run surge through npx - see here for details

how to use it ?

upload your folder

go in the right folder, and type

npx surge

will ask you a few questions

how to update it ?

see here https://stackoverflow.com/questions/49243509/how-to-update-your-surge-sh-project

more commands

npx surge --help

caveats: index.html

by default (i.e. if you use a URL with a hostname but no path) the website will search for a file named index.html
if you had written, say, cv.html, then pointing at the domain will result in a 404 - not ideal...

you can easily fix it by doing

conclusion

this can be a nice alternative to uploading your site on Github Pages