File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -32,18 +32,15 @@ app.set("view engine", "ejs");
3232app . set ( "views" , path . join ( __dirname , "views" ) ) ;
3333
3434app . get ( "/" , async ( req , res ) => {
35- try {
36- // Fetch the albums data from your database
37- const albums = await Album . find ( { } , "title releaseYear" ) . lean ( ) ;
38- // Render the EJS template with the data
39- res . render ( "index" , {
40- appName : "Taylor Swift API" ,
41- albums : albums ,
42- } ) ;
43- } catch ( error ) {
44- console . error ( "Error fetching albums:" , error . message ) ;
45- res . status ( 500 ) . send ( "Internal Server Error" ) ;
46- }
35+ const githubLink = "https://github.com/lakshaykamat/taylor-swift-api" ;
36+ const credist = [
37+ { name : "Lakshay Kamat" , githubLink : "https://github.com/lakshaykamat" } ,
38+ { name : "Ruchi Singh" , githubLink : "https://github.com/ruchisingh-dev" } ,
39+ ] ;
40+ // Render the EJS template with the data
41+ res . render ( "index" , {
42+ appName : "Taylor Swift API" ,
43+ } ) ;
4744} ) ;
4845
4946// Use routes from separate files
Original file line number Diff line number Diff line change 1+ const errorHandler = ( res , error , status = 500 ) => {
2+ console . error ( "Error:" , error . message ) ;
3+ res . status ( status ) . json ( { error : "Internal Server Error" } ) ;
4+ } ;
5+
6+ module . exports = errorHandler ;
You can’t perform that action at this time.
0 commit comments