-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhandler.map
1 lines (1 loc) · 2.87 KB
/
handler.map
1
{"version":3,"sources":["src/App.js","src/users.js","app.js"],"names":["App","props","data","map","user","i","name","Data","then","json","app","use","bodyParser","urlencoded","extended","express","static","path","resolve","__dirname","markup","fs","readFileSync","get","req","res","users","html","send","replace","module","exports","ssr"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAEA,MAAMA,MAAOC,KAAD,IAAW;AACrB,SACE;AAAC,mBAAD;AAAA;AACA;AAAA;AAAA;AAAA;AAAA,KADA;AAEA;AAAA;AAAA;AACGA,YAAMC,IAAN,CAAWC,GAAX,CAAe,CAACC,IAAD,EAAOC,CAAP,KAAa;AAC3B,eAAO;AAAA;AAAA,YAAI,KAAKA,CAAT;AAAaD,eAAKE;AAAlB,SAAP;AACD,OAFA;AADH;AAFA,GADF;AAUD,CAXD;;kBAaeN;;;;;;;;ACff;;;;AACA;;;;;;AAEA,SAASO,IAAT,GAAgB;AACZ,WAAO,+BAAM,4CAAN,EACFC,IADE,CACGN,QAAQA,KAAKO,IAAL,EADX,CAAP;AAEH;kBACcF;;;;ACPf;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;AAIA,MAAMG,MAAM,wBAAZ;;AAEAA,IAAIC,GAAJ,CAAQ,qBAAR;AACAD,IAAIC,GAAJ,CAAQC,qBAAWH,IAAX,EAAR;AACAC,IAAIC,GAAJ,CAAQC,qBAAWC,UAAX,CAAsB,EAAEC,UAAU,KAAZ,EAAtB,CAAR;AACAJ,IAAIC,GAAJ,CAAQI,kBAAQC,MAAR,CAAeC,eAAKC,OAAL,CAAaC,SAAb,EAAwB,WAAxB,CAAf,CAAR;;AAGA,MAAMC,SAASC,aAAGC,YAAH,CAAgBH,YAAY,aAA5B,EACb,MADa,CAAf;;AAIAT,IAAIa,GAAJ,CAAQ,IAAR,EAAc,CAACC,GAAD,EAAMC,GAAN,KAAc;AAC1B,yBAAOjB,IAAP,CAAYkB,SAAS;AACnB,UAAMC,OAAO,4BAAe,8BAAC,aAAD,IAAK,MAAMD,KAAX,GAAf,CAAb;AACAD,QAAIG,IAAJ,CAASR,OAAOS,OAAP,CAAe,YAAf,EAA6BF,IAA7B,CAAT;AACD,GAHD;AAID,CALD;;AAOAG,OAAOC,OAAP,CAAeC,GAAf,GAAqB,8BAAWtB,GAAX,CAArB","file":"handler.map","sourceRoot":"","sourcesContent":["import React,{Fragment} from \"react\";\n\nconst App = (props) => {\n return (\n <Fragment>\n <h1>Users</h1>\n <ul>\n {props.data.map((user, i) => {\n return <li key={i}>{user.name}</li>\n })}\n </ul>\n </Fragment>\n )\n}\n\nexport default App;","import React from 'react';\nimport fetch from 'isomorphic-fetch';\n\nfunction Data() {\n return fetch('https://jsonplaceholder.typicode.com/users')\n .then(data => data.json())\n}\nexport default Data;","import serverless from \"serverless-http\";\nimport express from \"express\";\nimport cors from \"cors\";\nimport bodyParser from \"body-parser\";\nimport React from \"react\";\nimport { renderToString } from \"react-dom/server\";\nimport App from \"./src/App\";\nimport Data from \"./src/users\";\nimport fs from \"fs\";\nimport path from \"path\";\n\n\n\nconst app = express();\n\napp.use(cors());\napp.use(bodyParser.json());\napp.use(bodyParser.urlencoded({ extended: false }));\napp.use(express.static(path.resolve(__dirname, \"./Browser\")));\n\n\nconst markup = fs.readFileSync(__dirname + \"/index.html\",\n \"utf8\"\n);\n\napp.get(\"**\", (req, res) => {\n Data().then(users => {\n const html = renderToString(<App data={users} />);\n res.send(markup.replace(\"<!--App-->\", html));\n });\n});\n\nmodule.exports.ssr = serverless(app);\n"]}