Go Pro Sign Up Login
0 days 0 hrs 0 min 0 sec

Summer Sale

50% off Level Up Pro until you unsubscribe.
Get access to ALL 128 courses on Level Up Tutorials

This is your last chance to get Level Up Pro for $145/year.

or Learn More
Moon Moon

Buy Now and unlock this series

$

49

.99

$

29

.99

yours forever

Become a Pro and unlock everything

$

24

.99

per month

More Complex UI Server

In this video, we will be doing some refactoring to fully separate our UI and API into different folders.

Downloads

Become a pro to download code and videos

Comments

11 months ago [edited]

Anyone else getting this in Chrome after clicking the verify link? Scott doesn't get this when he clicks on the link. Not sure if I'm missing something or if this is covered in a future video.

Deceptive site ahead
Attackers on authsvc.dev may trick you into doing something dangerous like installing software or revealing your personal information (for example, passwords, phone numbers, or credit cards). Learn more

Brian

11 months ago

I had to lower the security of Chrome to let it pass through. Anyway to get this to work without increasing the risk?

Brian

11 months ago [edited]

After breaking the project in two separate projects, why is the site not accessible even though I have caddy running? Was working before the split.

Any ideas on what to check?

Brian

11 months ago

Figured out the issue....but have a question regarding pathing of the index.html file from the public folder. I needed to change public to ../public when registering the fastify-static plugin. Any idea why???

Here is some code that i have in each of the folders.

API Folder
// originally had this in my API (this func resides in api folder)
// where path = /Users/.../my-git/auth-service/ui/src/public
export const registerStaticPlugins = (app) => {
  app.register(fastifyStatic, {
    root: path.join(__dirname, 'public'),
  });
  logMessage(`📂 Registered fastifyStatic plugin`, logLevel.STARTUP);
};
UI Folder
// BUT, in the UI folder I needed to change to "../public". Not sure why. Any idea? (this func resides in UI folder)
export const registerStaticPlugins = (app) => { 
  app.register(fastifyStatic, {
    root: path.join(__dirname, '../public'),
  });
  logMessage(`📂 Registered fastifyStatic plugin`, logLevel.STARTUP);
};
User avatar

Raul

12 months ago

I don't understand why you'd want it to be in 'deleted/removed/purged'? Maybe you should expand on that question

Hartwig

12 months ago

Question: why is the pulic folder in /api and not deleted/removed/purged in that folder under /api ?

Want to join the conversation?

Become a Pro member today!