@blocklet/crawler
v2.6.24
Published
blocklet crawler lib
Downloads
3,003
Readme
@blocklet/crawler
@blocklet/crawler is a package crawler for Blocklet.
Package Structure
The package is composed of both frontend and backend components. The backend code can be found in the middlewares folder.
Development
Install In Blocklet
# You can use npm / yarn
pnpm add @blocklet/crawlerInstall Dependencies
To install the required dependencies, run the following command:
pnpm iBuild Packages
To build the packages, execute the following command:
pnpm buildBuild, Watch, and Run Development Server
For building, watching changes, and running the development server, use the following command:
pnpm run devBackend Example
const { initSEOMiddleware, initCronCrawlBlocklet } = require('@blocklet/crawler/middlewares');
// init cron job to crawl blocklet that generate SEO pages
initCronCrawlBlocklet({
time: '0 0 */12 * * *',
});
const router = express.Router();
// init SEO middleware, when request come, we will return the SEO static page
router.use(initSEOMiddleware());License
This package is licensed under the MIT license.
