the-forest/client/node_modules/.cache/babel-loader/c68e9528535f498ff716bf8913c9d31a40c7f5b1abe149c0af6740bc77d72158.json
2024-09-17 20:35:18 -04:00

1 line
7.4 KiB
JSON

{"ast":null,"code":"var _jsxFileName = \"/Users/shoofle/Projects/the-forest/src/App.js\";\nimport logo from './logo.svg';\nimport './App.css';\nimport { Browser, Routes } from 'react-router-dom';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst url = \"http://127.0.0.1:8000\";\nfunction getCount() {\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n statements: ['SELECT count(*) FROM pages']\n })\n }).then(res => res.json()).then(data => requestOneOf(data[0].results.rows[0][0])).catch(err => console.log(err));\n}\nfunction requestOneOf(maximum) {\n const id_we_want = Math.floor(Math.random() * maximum) + 1;\n fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n statements: [{\n q: 'select * from pages where id=@val',\n params: {\n 'val': id_we_want\n }\n }]\n })\n }).then(res => res.json()).then(data => setCurrentPage(data[0].results.rows[0])).catch(err => console.log(err));\n}\nfunction setCurrentPage(row) {\n console.log(\"hey we got a page\");\n console.log(row);\n}\nfunction App() {\n getCount();\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"App\",\n children: /*#__PURE__*/_jsxDEV(\"header\", {\n className: \"App-header\",\n children: [/*#__PURE__*/_jsxDEV(\"img\", {\n src: logo,\n className: \"App-logo\",\n alt: \"logo\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n children: [\"Edit \", /*#__PURE__*/_jsxDEV(\"code\", {\n children: \"src/App.js\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 16\n }, this), \" and save to reload.\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"a\", {\n className: \"App-link\",\n href: \"/\",\n children: \"Go to here!\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(\"h3\", {\n children: \"Welcome to the forest!\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 5\n }, this);\n}\n_c = App;\nexport default App;\nvar _c;\n$RefreshReg$(_c, \"App\");","map":{"version":3,"names":["logo","Browser","Routes","jsxDEV","_jsxDEV","url","getCount","fetch","method","headers","body","JSON","stringify","statements","then","res","json","data","requestOneOf","results","rows","catch","err","console","log","maximum","id_we_want","Math","floor","random","q","params","setCurrentPage","row","App","className","children","src","alt","fileName","_jsxFileName","lineNumber","columnNumber","href","_c","$RefreshReg$"],"sources":["/Users/shoofle/Projects/the-forest/src/App.js"],"sourcesContent":["import logo from './logo.svg';\nimport './App.css';\nimport { Browser, Routes } from 'react-router-dom';\n\nconst url = \"http://127.0.0.1:8000\"\n\nfunction getCount() {\n fetch(url, {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({\n statements: ['SELECT count(*) FROM pages'],\n }),\n })\n .then((res) => res.json())\n .then((data) => requestOneOf(data[0].results.rows[0][0]))\n .catch((err) => console.log(err)); \n}\n\nfunction requestOneOf(maximum) {\n const id_we_want = Math.floor(Math.random() * maximum) + 1\n\n fetch(url, {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({\n statements: [{\n q: 'select * from pages where id=@val',\n params: {'val': id_we_want}\n }]\n })\n })\n .then((res) => res.json())\n .then((data) => setCurrentPage(data[0].results.rows[0]))\n .catch((err) => console.log(err));\n}\n\nfunction setCurrentPage(row) {\n console.log(\"hey we got a page\");\n console.log(row);\n}\nfunction App() {\n getCount();\n\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n Edit <code>src/App.js</code> and save to reload.\n </p>\n <a\n className=\"App-link\"\n href=\"/\">\n Go to here!\n </a>\n <div>\n <h3>Welcome to the forest!</h3>\n </div>\n </header>\n </div>\n );\n}\n\nexport default App;\n"],"mappings":";AAAA,OAAOA,IAAI,MAAM,YAAY;AAC7B,OAAO,WAAW;AAClB,SAASC,OAAO,EAAEC,MAAM,QAAQ,kBAAkB;AAAC,SAAAC,MAAA,IAAAC,OAAA;AAEnD,MAAMC,GAAG,GAAG,uBAAuB;AAEnC,SAASC,QAAQA,CAAA,EAAG;EAClBC,KAAK,CAACF,GAAG,EAAE;IACTG,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MAAC,cAAc,EAAE;IAAkB,CAAC;IAC7CC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;MACnBC,UAAU,EAAE,CAAC,4BAA4B;IAC3C,CAAC;EACH,CAAC,CAAC,CACCC,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEG,IAAI,IAAKC,YAAY,CAACD,IAAI,CAAC,CAAC,CAAC,CAACE,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACxDC,KAAK,CAAEC,GAAG,IAAKC,OAAO,CAACC,GAAG,CAACF,GAAG,CAAC,CAAC;AACrC;AAEA,SAASJ,YAAYA,CAACO,OAAO,EAAE;EAC7B,MAAMC,UAAU,GAAGC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAGJ,OAAO,CAAC,GAAG,CAAC;EAE1DlB,KAAK,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