mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
Use turbo & fix anonymous functions
This commit is contained in:
parent
3d9fde82c8
commit
4d9964623f
9 changed files with 1161 additions and 19 deletions
|
@ -3,7 +3,7 @@ import Head from 'next/head';
|
|||
|
||||
import { AppProps } from 'next/app';
|
||||
|
||||
export default function ({ Component, pageProps }: AppProps) {
|
||||
export default function App({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
|
|
|
@ -3,7 +3,7 @@ import aws from "aws-sdk";
|
|||
|
||||
const { BUCKET, ACCESS_KEY, SECRET_KEY, ENDPOINT, REGION } = process.env;
|
||||
|
||||
export default async function (req: NextApiRequest, res: NextApiResponse) {
|
||||
export default async function Storage(req: NextApiRequest, res: NextApiResponse) {
|
||||
aws.config.s3 = {
|
||||
accessKeyId: ACCESS_KEY,
|
||||
secretAccessKey: SECRET_KEY,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { NextApiRequest, NextApiResponse } from 'next';
|
||||
import { SpotifyService } from 'spotify-now-playing'
|
||||
|
||||
export default async function (req: NextApiRequest, res: NextApiResponse) {
|
||||
export default async function Spotify(req: NextApiRequest, res: NextApiResponse) {
|
||||
const { CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN } = process.env;
|
||||
const spotify = new SpotifyService(CLIENT_ID!, CLIENT_SECRET!, REFRESH_TOKEN!)
|
||||
const song = await spotify.getCurrentSong()
|
||||
|
|
|
@ -13,7 +13,7 @@ import profilePic from 'public/profile.webp';
|
|||
|
||||
export const fetcher = (url: RequestInfo) => fetch(url).then((r) => r.json());
|
||||
|
||||
export default function () {
|
||||
export default function Main() {
|
||||
var { data: spotify } = useSWR('/api/spotify', fetcher, {
|
||||
refreshInterval: 3000,
|
||||
fallbackData: 'loading',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue