blob: 8b7af5386212f6470d2c33c1592d9f6c85ef6f65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
use rspotify::spotify::client::Spotify;
use rspotify::spotify::oauth2::{SpotifyClientCredentials, SpotifyOAuth};
use rspotify::spotify::util::get_token;
mod serve;
fn main() {
// Set client_id and client_secret in .env file or
// export CLIENT_ID="your client_id"
// export CLIENT_SECRET="secret"
// export REDIRECT_URI=your-direct-uri
// Or set client_id, client_secret,redirect_uri explictly
// let oauth = SpotifyOAuth::default()
// .client_id("this-is-my-client-id")
// .client_secret("this-is-my-client-secret")
// .redirect_uri("http://localhost:8888/callback")
// .build();
rocket::ignite()
.mount("/", routes![serve::token, serve::get_tracks])
.launch();
}
|