#๐Ÿ”’ Help Needed: Connecting Dockerized Backend (Flask app) to Vercel-Hosted Next.js Frontend

12 messages ยท Page 1 of 1 (latest)

native sailBOT
#

@daring forge

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

daring forge
#

Help Needed๐Ÿฅบ: Connecting Dockerized Backend (Flask app) to Vercel-Hosted Next.js Frontend

sharp spire
#

You don't need cors

#

Cors is for multiple organizations who need to connect to each other

daring forge
# sharp spire Cors is for multiple organizations who need to connect to each other

alright but i need help to modify some of my backend files in order to acept api calls from the frontend

right now its all connected to the fronend like this below

@chat_bp.route('/chatbot')
def chatbot():
user_id = create_user_id()
redis_client.set(f"session_user:{user_id}", user_id)
is_rate_limited, time_remaining = track_user_requests(user_id, redis_client)
if is_rate_limited:
return redirect(url_for('main.rate_limit_exceeded', time_remaining=int(time_remaining)))
if 'user_location' not in session:
return redirect(url_for('location.location_permission'))
return render_template('try.html')

@chat_bp.route('/chat', methods=['POST'])
def chat():
"""Handle user chat messages and return responses."""
user_message = request.json.get('message')
history = session.get('history', [])
logging.debug(f"User message received: {user_message}")

# Correct the spelling of the user message
corrected_message = correct_spelling(user_message)
logging.debug(f"Corrected user message: {corrected_message}")
sharp spire
#

Use Amazon to serve both servers on the same domain and port

daring forge
#

instead of using vercel for the frontend?

#

i am using next js for the frontend

native sailBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ Help Needed๐Ÿฅบ: Connecting Dockerized Backend (Flask app) to Vercel-Hosted Next.js Frontend

native sailBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.