Help me to Code to make automatic Code

I want to make automatic send file in file area
I really don’t know how to say

Mainly i am doing like this to all files
app.get("/assets/css/main.css", function(request, response) {
response.sendFile(__dirname + “/assets/css/main.css”);
});

So Now i want to make this files to go to automatically to the file website
Like: htpps://projectname.glitch.me/main/css/main.css

This wanted to do automatically without the above Code

Hi SudhanPlayz!

If you look in ~hello-express’s server.js, there’s a line like this:

app.use(express.static("public"));

That means “everything in the public directory, just serve it as a file” - I think that’s what you want.

Hope this helps,

Johnicholas

1 Like

@Johnicholas Not working