-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. only trades screen is protected 2. better ui experience
- Loading branch information
Showing
11 changed files
with
110 additions
and
134 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,17 +1,16 @@ | ||
import { getCurrentPrice } from "@/lib/stockService"; | ||
import { StockPriceData } from "@/lib/types"; | ||
import ky from "ky"; | ||
import { NextResponse } from "next/server"; | ||
//export const runtime = 'edge'; //This specifies the runtime environment that the middleware function will be executed in. | ||
|
||
export async function GET(request: Request, p: { params: { symbol: string } }) { | ||
const priceresp = await ky(`https://www.optionsprofitcalculator.com/ajax/getStockPrice?stock=${p.params.symbol}&reqId=${new Date().getTime()}`, { | ||
retry: { | ||
limit: 3 | ||
} | ||
}).json<{ price: { last: number | undefined } }>(); | ||
const resp = await getCurrentPrice(p.params.symbol) | ||
return NextResponse.json({ | ||
quoteSummary: { | ||
price: { regularMarketPrice: priceresp.price.last as number } | ||
price: { | ||
regularMarketPrice: resp.price.last | ||
} | ||
} | ||
} as StockPriceData); | ||
} |
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
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
Oops, something went wrong.