Kevin Powell - Community

KPC

Kevin Powell - Community

A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.

Join

front-end

resources

back-end

ui-ux

os-and-tools

What does the backend server listens to??

when u make backend, does your server listen to your pages URL?? that is when u say host your webpage, it is hosted on a url. does the the back listen to THAT url? or the localhost of the machine that hosts the site? The little so knowledge i have about backend thus far, FR and BE communicate with eachother via API. But the question i asked above, this occurred to me when I was thinking about how when u click a link, it redirects user to a certain route.. Now there 2 possible ways that can be done as far as I can think of
We just simply use anchor tags or js with location.href to simply add that route to the Link and redirect. As user lands on that page, static elements r rendered and dynamics infos r fetched using API from the backend and later rendered. In this case i suppose the server can just listen to the machines localhost??...

need help with grid

```body{ background: linear-gradient(rgb(0, 0, 0), rgb(255, 255, 255)); height: 300vw; // position: sticky; }...

building a mobile app

Hello. I'm learning VS Code to create a mobile app in Flutter w/ a pedometer & notifications. Any advice? Thanks.

Data fetching issues?

Hi guys, doing a small e-commerce app, wanted to output the total number of products, the expected result is 12, but on output I got 2, which confused me. I checked on the test page via console.log and the total number of products is 12, I still can't figure out what is wrong First pic is length 2 for some reason (12 is expected) Second pic shows the code I ran to test The third pic is the output...
No description

Newbie in back end

I have a project that im doing for school, but im getting this error everytime and also im having some issues using xampp I want to make a register form and a login form and also the website will have a session so when i go to other html files its still getting that im in the same email what i wanted to do is...

How to delete a table data at once?

how to delete all the rows in a specific table in supabase using react query

need help with hosting a simple website

hi, i am new to hosting projects, i just hosted a simple node + express application on netlify and i seem to be having issues. in my node server.js file i have this app.get("/course/:id", (req, res) => { but when i go to "mynetlifyurl/course/1" i get the netlify page not found error ...

req.body returns undefined

haya!!. So today i was thinking of trying out backend. and i installed express and nodemon and started working on it. everything seemed to be working fine until I made a form in my html and tried to receive and log data in my server.js. But it seems like req.body always returns undefined . I know the server and client side is working fine cause when I submit, it gives my the error I coded in the server.post(). That means i am indeed sending post req to my server . Here is the github code the...

Arrows function can't be hoisted?

I saw this comment on a post on X. I know that functions are hoisted to the top but I have no idea about arrow functions. Are they really not hoisted to the top?...
No description

MERN Stack - Search box returning empty array

Hi. I'm developing a MERN stack web app, and am encountering a problem with my search box where if keywords provided in the search box do not match any product in the database, array returns [], whereas it is supposed to throw an error and therefore trigger react toastify for a 'product not found' notification. I'm unsure whether the problem is in the front or backend part of the project, but I provided all of the files I thought were of use. If anyone could help, I'd be very grateful. Let me kn...

Help setting up

Hi! So I am new to back-end, decided to learn it via a tutorial Can anyone help me get started? I've tried several things as to a workable demo (as that is required in step 1), but so far I've got no luck correctly launching the page outside of the Live Server from vsc...

Deploying...

I need help, I want to learn how to do the back-end, so I'm following this tutorial: https://www.freecodecamp.org/learn/back-end-development-and-apis/managing-packages-with-npm/how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package So I forked it and I figured I'll put it up on netlify, yet I keep on getting page not found do I need to do smth special? do In eed to have the paid plan, why is it not deploying...
No description

How do I publish a public lib locally without adding a `run` script just for me?

Here's the context: I've built my own public library. I'm also building an app that uses this library. I may need to modify the library to fit the app's use case, and until the dust settles on that effort, I do not want to npm publish the library while I iterate on this use case. When lib is modified, I'd like to publish locally so my app can get the latest code. The only way I know how to do that is to add a npm run build-and-publish-locally-because-i-am-iterating-on-app to lib's package.json. That feels wrong: lib is open source, intended to be used by strangers, and I don't want to accidentally publish that script if I need to fix an unexpected, unrelated lib bug. Is there a better approach to this problem? I don't think I'm the first person to create my own library for my own app. How do most handle this?...

Setting up a php developer environment using Docker

How do you setup a php developer environment using docker along with a database, and node since ill be doing a small practice fullstack project?

CSS Sticky Mystery

Hey There, I hope you are well? I should point out I am not a coder at all - but i do know enough to be no bother whatsoever. I am trying to implement a Sticky element in my site which I have made with Adobe Muse (it is outdated, I know...). ...

HTML and API issue

Hi everyone i need serious help right now. so i have made an api with a sqlite3 database that holds values of name, rating, and id(that is auto given) and i am making a html client app that allows a user to edit this database using http methods, i have got GET and DELETE working but i am struggling severely with the POST and PUT methods and was wondering if anyone specializes in anything similar. Please help and thanks for your time

CORS keeps blocking request during preflight on the browser

I'm trying to access my API from the browser but the request is blocked by CORS, with the error "Access to XMLHttpRequest at 'http://localhost/3001/auth/login/staff' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource." I tried adding Access-Control-Allow-Origin to allow headers in Cors config but it's not working, I've tested the endpoint on Postman and it works, I'm attaching screenshots of my code(I don't know how to setup nestjs in code sandbox), here's the link to GitHub https://github.com/johnpatrick254/School-Management-System/ on client-webapp branch Any assistance will be highly appreciated!...
No description

Problem with google provider and next-auth.

Im having difficulties figuring out how to fix this error: nique constraint failed on the constraint: users_username_key { message: '\n' + 'Invalid prisma.user.create() invocation:\n' +...

I'm building a library. Is there a logger that can be configured by the user?

For those that know Java, I'm basically asking if slf4j exists in node. For those that don't know Java, I'm building a library that needs to output logs to: 1. Give me enough information to troubleshoot issues when apps use it....