Create a Flask API
NayakPenguin opened this issue · 2 comments
Initialize Flask Application:
Begin by setting up a Flask application that remains operational continuously.
Define "Hello World" Endpoint: Create an API endpoint that responds with the message "hello world" upon receiving requests.
Incorporate Time-Based Restrictions:
Implement time-based access restrictions to control API responses during specific hours.
Week-Based Access Logic:
Design access control logic based on the current week number.
- Week 1 Restrictions: For the first week, restrict API access on Sunday from 8:00 AM to 9:30 AM in the morning.
- Week 2 Restrictions: During the second week, limit access on Saturday from 8:00 PM to 9:30 PM in the evening and on Sunday from 8:00 AM to 9:30 AM in the morning.
- Week 3 Restrictions: In the third week, restrict API access on Sunday from 8:00 AM to 9:30 AM in the morning.
- Week 4 Restrictions: During the fourth week, impose access restrictions on Saturday from 8:00 PM to 9:30 PM in the evening and on Sunday in the morning.
Return "API Restricted" During Restricted Hours:
If the current time falls within the restricted hours specified for the respective week, have the API return the message "API restricted."
Launch and Maintain Flask Application:
Finally, initiate the Flask application to ensure it operates continuously and adapts its responses as per the specified time-based restrictions.
How to run the repo locally :
Check #104
Important :
- Please don't change any file other than what is mentioned - if you want please mention it below.
How to get your PR accepted :
- Consider giving our project a star as it helps enhance the project's credibility.
- Write the PR title as - #127 Issue Resolved | {something you want to mention}
- Write a good PR comment with a screen-shot of the work
- Make sure to generate the PR to the main branch of this repository.
Express your interest in the open-conversion section below to request this issue as an assignee! Enjoy your coding journey! :) 🚀
I am interested, I want to work on this project.
@priyam-03 ok amazing, I am assigning this task to you :)