@@ -23,22 +23,34 @@ router.use((req, res, next) => {
2323 }
2424} )
2525
26- router . post ( '/jsonToStyledExcel' , async ( req , res ) => {
26+ router . post ( '/lambda/json-to-excel/styled' , async ( req , res ) => {
27+ console . log ( 'styled working' )
2728 const jsonData = req . body . excel
2829 const defaultStyle = req . body . config . default_style
2930 const excelData = await convertJsonToStyledExcel ( jsonData , defaultStyle )
3031 const url = await uploadToAWS ( req . body . config , excelData )
3132 return res . json ( { url } )
3233} )
3334
34- router . post ( '*' , async ( req , res ) => {
35+ router . post ( '/styled' , async ( req , res ) => {
36+ console . log ( 'styled not working form infra side' )
37+ return res . json ( { message : "jsonToStyledExcel" } )
38+ } )
39+
40+ router . post ( '/api/jsonToExcel' , async ( req , res ) => {
41+ console . log ( 'old path' )
3542 const jsonData = req . body . excel
3643 const excelData = await convertJsonToExcel ( jsonData )
3744 const link = await uploadToAWS ( req . body . config , excelData )
3845
3946 return res . json ( link )
4047} )
4148
49+ router . post ( '*' , async ( req , res ) => {
50+ console . log ( 'default path' )
51+ return res . json ( { message : "default path" } )
52+ } )
53+
4254const uploadToAWS = async ( config , excelData ) => {
4355 const { s3FilePublic, s3Region, s3Bucket, s3KeyId, s3SecretKey, s3Path } = config
4456
@@ -127,6 +139,8 @@ if (!isAWSLambda) {
127139const handler = serverless ( app )
128140
129141exports . handler = async ( event , context , callback ) => {
130- const response = handler ( event , context , callback )
142+ // console.log("entryyyyyy---->", event)
143+ const response = await handler ( event , context , callback )
144+ // console.log('request closed as response', response)
131145 return response
132146}
0 commit comments