@@ -153,12 +153,14 @@ app.get('/profileAll', async (req, res)=>{
153
153
app . get ( '/profile/:username' , async ( req , res ) => {
154
154
const { username} = req . params ;
155
155
const data = await client . query ( `SELECT * FROM profile WHERE username = '${ username } '` ) ;
156
+ console . log ( "data" , data )
156
157
res . send ( data . rows ) ;
157
158
console . log ( "Data sent successfully4" ) ;
158
159
} ) ;
159
160
160
161
app . post ( '/addprofile' , ( req , res ) => {
161
162
const { username, name, description, website, location, image, role} = req . body ;
163
+ console . log ( "image" , image ) ;
162
164
createProfile ( username , name , description , website , location , image , role ) ;
163
165
res . send ( 'Data inserted' ) ;
164
166
@@ -201,12 +203,15 @@ app.post('/upload/product', (req, res)=>{
201
203
app . get ( '/file/profile/:fileName' , function ( req , res ) {
202
204
const { fileName} = req . params ;
203
205
const filePath = path . join ( __dirname , 'public/uploads/profile' , fileName ) ;
206
+ console . log ( 'Serving file from:' , filePath ) ;
204
207
res . sendFile ( filePath ) ;
205
208
} ) ;
206
209
207
210
app . get ( '/file/product/:fileName' , function ( req , res ) {
208
211
const { fileName} = req . params ;
209
212
const filePath = path . join ( __dirname , 'public/uploads/product' , fileName ) ;
213
+ console . log ( 'Serving file from:' , filePath ) ;
214
+
210
215
res . sendFile ( filePath ) ;
211
216
} ) ;
212
217
0 commit comments