Discuss Scratch

god286
Scratcher
1000+ posts

Scratchinfo - an epic website

I've got a big problem:
I need to fetch to /foo/bar for something.
So when I fetch to /foo/bar
the first / means the directory of the site right?
BUT it says “INVALID_URL”
But I have to fetch
http://localhost:3000/foo/bar
when the website is in production it won't work obviously

Can someone help?

Last edited by god286 (Nov. 18, 2021 00:15:33)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
MagicCrayon9342
Scratcher
1000+ posts

Scratchinfo - an epic website

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL

god286
Scratcher
1000+ posts

Scratchinfo - an epic website

MagicCrayon9342 wrote:

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL
I edited my question with a bit more information.
Your answer won't help… sorry
Also, ScratchInfo isn't on Localhost when you view it on the web.

Last edited by god286 (Nov. 18, 2021 00:16:57)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
MagicCrayon9342
Scratcher
1000+ posts

Scratchinfo - an epic website

god286 wrote:

MagicCrayon9342 wrote:

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL
I edited my question with a bit more information.
Your answer won't help… sorry
Also, ScratchInfo isn't on Localhost when you view it on the web.
Localhost is, localhost. It is your ‘Local’ ‘Host’
Localhost is being served to an IP/Gateway. ScratchInfo has a domain. Also, without a domain. It would be viewable as your Public IP.
ScratchInfo IS on Localhost, port forwarded, and some stuff with the DNS server.

you might already know this idk

Last edited by MagicCrayon9342 (Nov. 18, 2021 00:29:11)


god286
Scratcher
1000+ posts

Scratchinfo - an epic website

MagicCrayon9342 wrote:

god286 wrote:

MagicCrayon9342 wrote:

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL
I edited my question with a bit more information.
Your answer won't help… sorry
Also, ScratchInfo isn't on Localhost when you view it on the web.
Localhost is, localhost. It is your ‘Local’ ‘Host’
Localhost is being served to an IP/Gateway. ScratchInfo has a domain. Also, without a domain. It would be viewable as your Public IP.
ScratchInfo IS on Localhost, port forwarded, and some stuff with the DNS server.

im a nerd ik lmao
In this case I want it so that I dont need to add the localhost:port part

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

I fixed it, but it's a very werid workaround (Rich harris plz fix)
let protocol = "https://"
if (request.host.startsWith("localhost:")) {
   protocol = "http://" // on localhost dont expect https
}
const fetchAddress = `${protocol}${request.host}/myThing`
ignore the thing getting angry at the `
yeah its a bad workaround but it works

Last edited by god286 (Nov. 18, 2021 02:01:09)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

ScratchLight works! But I don't know if it is secure… or if it can be hacked…

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
MagicCrayon9342
Scratcher
1000+ posts

Scratchinfo - an epic website

god286 wrote:

MagicCrayon9342 wrote:

god286 wrote:

MagicCrayon9342 wrote:

if you remove localhost, you just have :3000/foo/bar
of course thats an invalid URL

localhost is the address
you need it in the URL
I edited my question with a bit more information.
Your answer won't help… sorry
Also, ScratchInfo isn't on Localhost when you view it on the web.
Localhost is, localhost. It is your ‘Local’ ‘Host’
Localhost is being served to an IP/Gateway. ScratchInfo has a domain. Also, without a domain. It would be viewable as your Public IP.
ScratchInfo IS on Localhost, port forwarded, and some stuff with the DNS server.

im a nerd ik lmao
In this case I want it so that I dont need to add the localhost:port part
you don't have too, just use the domain. If you really need to test it without using the domain, you can just have a it open when you open Firefox. or have a bookmark. There is no working around using localhost:port, you can just do localhost if you set the port to a standard HTTPS port.

god286
Scratcher
1000+ posts

Scratchinfo - an epic website

MagicCrayon9342 wrote:

-snip-
you don't have too, just use the domain. If you really need to test it without using the domain, you can just have a it open when you open Firefox. or have a bookmark. There is no working around using localhost:port, you can just do localhost if you set the port to a standard HTTPS port.
I already have a solution, but thanks

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
MagicCrayon9342
Scratcher
1000+ posts

Scratchinfo - an epic website

god286 wrote:

MagicCrayon9342 wrote:

-snip-
you don't have too, just use the domain. If you really need to test it without using the domain, you can just have a it open when you open Firefox. or have a bookmark. There is no working around using localhost:port, you can just do localhost if you set the port to a standard HTTPS port.
I already have a solution, but thanks
Also, constantly worrying about something being ‘hacked’ is pretty dumb. Everything has security vulnerabilities, so it's not worth it.

kccuber
Scratcher
1000+ posts

Scratchinfo - an epic website

god286 wrote:

ScratchLight works! But I don't know if it is secure… or if it can be hacked…
uhh just a question, but what's scratchlight?


Made using Nord Theme & Inkscape
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

kccuber wrote:

god286 wrote:

ScratchLight works! But I don't know if it is secure… or if it can be hacked…
uhh just a question, but what's scratchlight?
uhh its my auth thing which supports comments and will be enabled soon

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

test out scratchlight today
https://scratchinfo.vercel.app/
yay

Last edited by god286 (Nov. 19, 2021 00:12:14)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
JoshAtticus
Scratcher
100+ posts

Scratchinfo - an epic website

god286 wrote:

I've got a big problem:
I need to fetch to /foo/bar for something.
So when I fetch to /foo/bar
the first / means the directory of the site right?
BUT it says “INVALID_URL”
But I have to fetch
http://localhost:3000/foo/bar
when the website is in production it won't work obviously

Can someone help?
Remove the "http://" part, localhost and http are different protocols

~~I'm JoshAtticus!~~
I enjoy scratching, playing with tech and online privacy(not google)

Check out the OSMANiC Website!

This account is in an archived state, I don't post projects here, and I might not be very active with comments and forums
I have 2 new accounts: @OSMANiC Team & @OSMANiCBetas



^^Made with Figlet^^










JoshAtticus
Scratcher
100+ posts

Scratchinfo - an epic website

I have a problem w/ the You page, I go to the authenticator and complete it, however scratch info then says Invalid Authentication

~~I'm JoshAtticus!~~
I enjoy scratching, playing with tech and online privacy(not google)

Check out the OSMANiC Website!

This account is in an archived state, I don't post projects here, and I might not be very active with comments and forums
I have 2 new accounts: @OSMANiC Team & @OSMANiCBetas



^^Made with Figlet^^










god286
Scratcher
1000+ posts

Scratchinfo - an epic website

JoshAtticus wrote:

I have a problem w/ the You page, I go to the authenticator and complete it, however scratch info then says Invalid Authentication
Hmm.. thats weird. can you log network when you go to the you page
maybe try to go to the Scratchlight login https://scratchinfo-git-scratchlight-webdev03.vercel.app/dashboard

Last edited by god286 (Nov. 18, 2021 06:51:16)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
JoshAtticus
Scratcher
100+ posts

Scratchinfo - an epic website

god286 wrote:

JoshAtticus wrote:

I have a problem w/ the You page, I go to the authenticator and complete it, however scratch info then says Invalid Authentication
Hmm.. thats weird. can you log network when you go to the you page
maybe try to go to the Scratchlight login https://scratchinfo-git-scratchlight-webdev03.vercel.app/dashboard
Yes

~~I'm JoshAtticus!~~
I enjoy scratching, playing with tech and online privacy(not google)

Check out the OSMANiC Website!

This account is in an archived state, I don't post projects here, and I might not be very active with comments and forums
I have 2 new accounts: @OSMANiC Team & @OSMANiCBetas



^^Made with Figlet^^










Chiroyce
Scratcher
1000+ posts

Scratchinfo - an epic website

If you fetch “/foo/bar” on localhost:3000, it will default to
http://localhost:3000/foo/bar
if you do it on https://example.com, it will default to
https://example.com/foo/bar

Last edited by Chiroyce (Nov. 18, 2021 08:37:27)








April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

Chiroyce wrote:

If you fetch “/foo/bar” on localhost:3000, it will default to
http://localhost:3000/foo/bar
if you do it on https://example.com, it will default to
https://example.com/foo/bar
But that's not the behaviour in SvelteKit endpoints, so I used a workaround #286 to fix it.
Edit: So fitting, that post is number #286 hah

Last edited by god286 (Nov. 18, 2021 08:39:12)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
god286
Scratcher
1000+ posts

Scratchinfo - an epic website

300th post! WOOHOO
Thanks everyone! It's been fun

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.

Powered by DjangoBB