Source code exposed through URL #6143
Replies: 2 comments
-
if you want to exploit vercel to serve as a backend server, you have to rewrite all the request under any path to the root
FYI and make some adjust to output directory |
Beta Was this translation helpful? Give feedback.
0 replies
-
This discussion was automatically locked because the community moved to a new site. Please join us at vercel.community |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I have a simple node.js project written in TypeScript with a single serverless function inside the
api
folder. No framework used and nothing specified in the vercel.json config. Everything seems to work as expected, but there is an issue where I can access all my source files by entering the right URL. Example: example.vercel.app/api/index.ts. When entering the URL, the file starts downloading. I find this rather alarming. Is this normal behaviour for serverless functions or am I missing something? I have not found anything mentioning this in the docs or on any forum, except for the Directory listing option under settings - advanced, but this only makes things worse.Example
No response
Steps to Reproduce
Enter domain/path_to_source_file for a serverless function project and the file starts downloading immediately.
Beta Was this translation helpful? Give feedback.
All reactions