Skip to content

Commit

Permalink
vercel-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jookie committed Sep 26, 2024
1 parent 850435b commit b43db3e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/api/t1.py

This file was deleted.

20 changes: 20 additions & 0 deletions app/api/user.vercel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from http.server import BaseHTTPRequestHandler
from os.path import join
from posixpath import abspath, dirname
dir = dirname(abspath(__file__))

class handler(BaseHTTPRequestHandler):

def do_GET(self):
self.send_response(200)
self.send_header('Content-type','text/plain')
self.end_headers()

# You can use the path relative to the project's base directory.
# with open(join('data', 'file.txt'), 'r') as file:

# Or you can use the path relative to the current file's directory.
with open(join(dir, '..', 'data', 'file.txt'), 'r') as file:
for line in file:
self.wfile.write(line.encode())
return

0 comments on commit b43db3e

Please sign in to comment.