File tree Expand file tree Collapse file tree 4 files changed +3
-6
lines changed
Expand file tree Collapse file tree 4 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ export type User = {
77 } ;
88
99export const getUserCollection = async ( ) => {
10- const client : MongoClient = new MongoClient ( 'mongodb://localhost:27017' ) ;
10+ const client : MongoClient = new MongoClient ( process . env . MONGODB_URI ?? 'mongodb://localhost:27017' ) ;
1111 await client . connect ( ) ;
1212 const db : Db = client . db ( 'brus' ) ;
1313 const user_collection = db . collection < User > ( 'users' ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export default function Home() {
2626 const [ users , setUsers ] = useState < User [ ] > ( [ ] ) ;
2727
2828 const fetchUsers = async ( ) => {
29- const response = await fetch ( 'http ://localhost:3000/api/users' ) ;
29+ const response = await fetch ( ` ${ process . env . NEXT_PUBLIC_API_URL ?? 'https ://localhost:3000/api' } /users` ) ;
3030 const data = await response . json ( ) ;
3131 setUsers ( data ) ;
3232 } ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ export default function BuyBrusModal(props: {
3434 amount,
3535 } ;
3636
37- const response = await fetch ( 'http://localhost:3000/api/buybrus' , {
37+ const response = await fetch ( ` ${ process . env . NEXT_PUBLIC_API_URL ?? 'http://localhost:3000/api' } /buybrus` , {
3838 method : 'POST' ,
3939 headers : {
4040 'Content-Type' : 'application/json' ,
You can’t perform that action at this time.
0 commit comments