tools = require('../js/tools'); tools.init()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 surgewill ask you a few questions
you will have to enter a login / password; this will create your account when using surge for the first time
you will have to enter a domain name: if you answer
jeanmineur-resume, thenhttps://jeanmineur-resume.surge.shbecomes available in a matter of seconds, populated with the contents of the current folder
how to update it ?¶
see here https://
more commands¶
npx surge --helpcaveats: 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