Download wp-calypso/client/server/pwa/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 519 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/server/pwa/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/server/pwa/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/server/pwa/index.js
519 Bytes
| import path from 'path'; | |
| import express from 'express'; | |
| import manifest from './manifest'; | |
| export default () => { | |
| const app = express(); | |
| // manifest is part of PWA spec, and needs to be dynamic so we can inject l10n, branchName and other context | |
| app.get( '/calypso/manifest.json', manifest ); | |
| // service-worker needs to be served from root to avoid scope issues | |
| app.use( | |
| '/service-worker.js', | |
| express.static( path.resolve( __dirname, '..', '..', '..', 'public', 'service-worker.js' ) ) | |
| ); | |
| return app; | |
| }; | |