-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from hurry-harry/hf-link-auth-api
Leftover commit
- Loading branch information
Showing
11 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export const SPOTIFY_MY_PROFILE: string = "https://api.spotify.com/v1/me"; | ||
export const SPOTIFY_MY_TOP_ITEMS: string = "https://api.spotify.com/v1/me/top"; | ||
export const SPOTIFY_ALBUMS: string = "https://api.spotify.com/v1/albums"; | ||
export const SPOTIFY_NEW_RELEASES: string = "browse/new-releases"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum SpotifyTopItemCategories { | ||
Artists = "artists", | ||
Tracks = "tracks" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface Environment { | ||
apiUrl: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { HttpClient } from "@angular/common/http"; | ||
import { environment } from "../../../environments/environment"; | ||
import { Observable } from "rxjs"; | ||
import { Injectable } from "@angular/core"; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class SpotifyService { | ||
constructor( | ||
private http: HttpClient) { } | ||
|
||
login(): Observable<any> { | ||
console.log('login triggered'); | ||
return this.http.post(`${environment.apiUrl}/login`, {}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
test 3 | ||
|
||
<router-outlet></router-outlet> | ||
<router-outlet></router-outlet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
import { Routes } from '@angular/router'; | ||
import { LoginComponent } from './components/login/login.component'; | ||
import { HomeComponent } from './components/home/home.component'; | ||
import { AuthorizedComponent } from './components/authorized/authorized.component'; | ||
|
||
export const routes: Routes = []; | ||
export const routes: Routes = [ | ||
{ path: '', component: LoginComponent }, | ||
{ path: 'home', component: HomeComponent }, | ||
{ path: 'authorized', component: AuthorizedComponent }, | ||
|
||
{ path: '**', redirectTo: '' } | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Environment } from "../app/_shared/models/environment.model"; | ||
|
||
export const environment: Environment = { | ||
apiUrl: "http://localhost:8888/" // replace with whatever host provider for the server-side | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Environment } from "../app/_shared/models/environment.model"; | ||
|
||
export const environment: Environment = { | ||
apiUrl: "http://localhost:8888/" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Environment } from "../app/_shared/models/environment.model"; | ||
|
||
export const environment: Environment = { | ||
apiUrl: "http://localhost:8888" | ||
} |