Skip to content

learn-co-curriculum/course-8-module-6-connect-client-server-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lab: Building a Front-to-Back Event Catalog

Learning Goals

  • Serve a homepage using Flask
  • Create API routes that return and accept JSON
  • Handle GET and POST requests on the back end
  • Connect a Flask back end to a static front end
  • Pass all provided back end tests

Setup Instructions

1. Clone the Repository

git clone <repo-url>
cd course-8-module-6-connect-client-server-lab

2. Create Your Environment

Using Pipenv:

pipenv install
pipenv shell

Running the App

python server.py

Then open client/index.html in your browser to view the frontend.


Running the Tests

To check your work, run:

pytest

All tests must pass to complete the lab.


Your Tasks

  • Implement the / route to return a welcome message in JSON
  • Implement a GET /events route that returns all event data
  • Implement a POST /events route that accepts a new event and returns it with status 201
  • Return a 400 Bad Request if required data is missing in a POST

File Structure

.
├── client/
│   ├── index.html
│   ├── styles.css
│   └── script.js
├── server.py
├── tests/
│   └── test_app.py
├── Pipfile
├── Pipfile.lock
├── README.md

Good luck! 🚀

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •