New accounts come with localhost and 127.0.0.1 already registered, so you can test on your own computer right away. If yours are missing, add them in Settings.
-
Any port works. Register
localhostwithout a port: a page athttp://localhost:8080matches it. - Set
SomApi.domainName = location.hostname;so the same code works on your computer and on your live site. -
Use a local web server, not a file opened from disk. A
file://page has no domain, so the test can't start.
No local server? Either of these works:
python3 -m http.server 8080
npx serve -p 8080
Then open http://localhost:8080. Once your site is live, you can remove localhost from your domains.