Algolisted-Org / AlgoListed

Algolisted is an AI-powered platform dedicated to assisting computer science students in preparing for placements and internships. Our services include tracking and analytics across various platforms and topics.
http://algolisted.com
Other
164 stars 99 forks source link

Create a Flask API #127

Closed NayakPenguin closed 1 year ago

NayakPenguin commented 1 year ago

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.

  1. Week 1 Restrictions: For the first week, restrict API access on Sunday from 8:00 AM to 9:30 AM in the morning.
  2. 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.
  3. Week 3 Restrictions: In the third week, restrict API access on Sunday from 8:00 AM to 9:30 AM in the morning.
  4. 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 :

  1. Please don't change any file other than what is mentioned - if you want please mention it below.

How to get your PR accepted :

  1. Consider giving our project a star as it helps enhance the project's credibility.
  2. Write the PR title as - #127 Issue Resolved | {something you want to mention}
  3. Write a good PR comment with a screen-shot of the work
  4. 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! :) 🚀

priyam-03 commented 1 year ago

I am interested, I want to work on this project.

NayakPenguin commented 1 year ago

@priyam-03 ok amazing, I am assigning this task to you :)