Spotify backend server
This commit is contained in:
parent
e8d0a25fc9
commit
3802bce17d
6 changed files with 220 additions and 14 deletions
31
src/App.js
31
src/App.js
|
@ -1,26 +1,31 @@
|
|||
import React from 'react';
|
||||
import logo from './logo.svg';
|
||||
import './App.css';
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import logo from './logo.svg'
|
||||
import './App.css'
|
||||
|
||||
function App() {
|
||||
let [token, setToken] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
const search = window.location.search
|
||||
const params = new URLSearchParams(search)
|
||||
setToken(params.get('access_token'))
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<img src={logo} className="App-logo" alt="logo" />
|
||||
|
||||
<p>
|
||||
Edit <code>src/App.js</code> and save to reload.
|
||||
</p>
|
||||
<a
|
||||
className="App-link"
|
||||
href="https://reactjs.org"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Learn React
|
||||
</a>
|
||||
|
||||
<a href='http://localhost:8888/login' className='App-link'> Login to Spotify </a>
|
||||
|
||||
<p>{token}</p>
|
||||
</header>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export default App;
|
||||
export default App
|
||||
|
|
21
src/views/ArtistSearch.jsx
Normal file
21
src/views/ArtistSearch.jsx
Normal file
|
@ -0,0 +1,21 @@
|
|||
import React, { useState, useEffect } from 'react'
|
||||
|
||||
function ArtistSearch() {
|
||||
let [token, setToken] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
const search = window.location.search
|
||||
const params = new URLSearchParams(search)
|
||||
setToken(params.get('access_token'))
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="artist-search">
|
||||
<h1>Artist search</h1>
|
||||
|
||||
<p>{token}</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default ArtistSearch
|
Loading…
Add table
Add a link
Reference in a new issue