I am using /style for style.css and am using this code;
app.get("/style", (req, res) => res.sendFile(__dirname + "/assets/style.css"))
I don't want them to enter to /style address and steal styles, so i want people to get an error that they enter the /style address. How can i do?
There is no difference between a URL in <link rel="stylesheet" url=.. and a URL that the user enters in the browser address bar.
Both are endpoints that the browser needs to GET. You can put your whole app behind an authenticated endpoint. But once the client is authenticated and the page is rendered, the users may use dev tools to see your styles.
As an alternative you can use tools to minimize and obfuscate the styles. It makes sense for minification and optimization purposes, but not for protecting the sources. I would also consider what you are trying to protect (CSS styling is not a trade secret and you can copyright your logo/brand style to protect it).