Custom Node Server Connect module - show all URL properties

This module takes a URL and splits it down to its individual components

This can be installed as outlined in the below post

This node server connect module breaks a supplied URL into it's constituent parts

image

for example, the url

https://www.domain.co.uk:8080/path/here

will resolve to the following components

{
myobjects: {
hostname: "www.domain.co.uk",
host: "www.domain.co.uk:8080",
href: "https://www.domain.co.uk:8080/path/here",
origin: "https://www.domain.co.uk:8080",
pathname: "/path/here",
port: "8080",
protocol: "https:",
domain: "domain.co.uk",
subdomain: "www",
tld: "co.uk",
sld: "domain"
}
}

This module uses the native URL object and the psl npm dependency.

6 Likes

Thanks Ben!

Curious to know which use case prompted this?

I think this one:

1 Like

Wowza Brian, that’s other brilliant one. Great work.!

Firstly, it's Brian not Ben. we live on opposite ends of the globe but share a common ideology.

So what a simple question with so many deep connotations. It has triggered a thought process which may not have normally surfaced.

So here are my top 10

Technical

  1. Firstly yes, it was the TMR post above which created the initial idea/ use case

  2. Once the original formatter was produced i was unhappy with the way it handled sub domains as the standard URL properties does not cater for that. I was also aware that the URL object had so much more which could be easily exposed.

  3. I discovered the psl npm which managed sub domains as i wanted so added that.

  4. having done that i decided there was no benefit in not exposing all the available properties so hence the extension.

  5. At many times i have needed to "split" URLs to extract parts such as when doing dynamic SEO so this provides a comprehensive solution

But also so much more behind that "why" on a personal level, why even if no strong real use case

  1. I am now 100% retired and have no need or desire to work but need to keep my mind active

  2. I love coding/ Wappler but can't be bothered with whinging customers (and let's face it even the best do). Life is too short ( a fact brought home to me due to a recent cancer scare 18 months ago)

  3. I have had a few forum members ask if i could do a tutorial on building custom extensions. To do that i need to understand the subject. I learn by doing, so the current extensions I am publishing are a side product of that learning.

  4. I have a very low boredom threshold, i need to keep my mind active. Watching daytime TV or stamp collecting :rofl: are not options i relish. I constantly scan the forum for new ideas and projects to fill my time.

  5. Lastly, i guess i am making the most of my Wappler subscription, now I am retired, i need to consider if I am going to renew when my only use case (to use your term) is to provide free support, tutorials and extensions. Undecided at present

So that is the use case and associated why.

Writing that was actually quite cathartic, it allowed me to gather my thoughts about where i am now and going forward so thanks for your question @karh even if it prompted far more of a response than you expected. :grinning:

3 Likes

My apologies! Don't know how I got that mixed up.

Thanks for the elaborate reply. Glad to hear it had a cathartic effect.

I appreciate that you're doing this... if I have extension ideas I'll drop them in your inbox, worth a shot I suppose?

If you're willing to share, I'm very curious what your answer is to this realization:

What do you feel is a worthy thing to spend time on?

Also, I hope you're staying healthy!

I will certinly lookat any proposal

Doing what I enjoy with the option to do it or not. Not being beholding or answerable to anyone

2 Likes

I look forward to seeing your stamp collecting website built with Wappler @Hyperbytes !

I once did a comic indexing app some years ago, does that count?

2 Likes