Skip to content

matty-r/unsplash_actix_react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Simple Actix (backend) and React (frontend) "proxy" for Unsplash, rather than the frontend directly querying Unsplash, the query will go to the backend, and it will return the results to the frontend. This was put together to supplement my learning of the "Modern React with Redux" Udemy course (LINK), when building the Pics app.

untitled.mp4

Prerequisites

Setup

Go into frontend directory, install the required npm stuffs

  1. cd frontend
  2. npm install --save-dev react-scripts

Get an API key from Unsplash and place it into frontend/src/config/config.json

  1. cd src/config
  2. nano config.json .. "UNSPLASH_API_KEY"

Return to frontend root, Build the frontend

  1. cd ../..
  2. npm run build

Head back to the root directory, and run the backend

  1. cd ../

  2. cargo run

  3. From your browser on your local machine, navigate to localhost:8081, and run a search.

  4. Or, make a curl request against the running server from your terminal:

curl "http://localhost:8081/img?query=cars" -H "Authorization: Client-ID putyour-api-keyhere"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published