Git Product home page Git Product logo

Comments (3)

tirthbodawala avatar tirthbodawala commented on August 14, 2024 1

Ohhh... I see what you want to achieve here... I will need to work for this enhancement.
Its definitely going to my todo-list for the weekend.

from react-pwa.

tirthbodawala avatar tirthbodawala commented on August 14, 2024

@rizwanzaheer @ezwon:

I have added hooks to the system of PawJS and they can be used as below in src/server.js

// ... previous imports..
// add below lines
import React from "react";
import serverHooks from "pawjs/src/server/hooks";
// ...other code
/**
 * --- Your custom code END ---
 */
// Add hooks middleware
app.use(serverHooks);
app.use((req, res, next) => {
  res.locals.wook.add_filter("paw_head", head => {
    head.push(
      <script
        type="application/ld+json"
        key="atyantik-org"
        dangerouslySetInnerHTML={{__html: `{
          "@context": "http://schema.org",
          "@type": "Organization",
          "name": "Atyantik Technologies",
          "description": "We are ultimate technology maniacs",
          "url": "https://www.atyantik.com/",
          "telephone": "+91 265 2530860",
          "address": {
            "@type": "PostalAddress",
            "addressCountry": "India"
          }
        }`}}
      />
    );
    return head;
  });
  next();
});
app.use(serverMiddleware);
// ... other code

from react-pwa.

naga-RajanR avatar naga-RajanR commented on August 14, 2024

Hi I am using react-pwa version 2.2.8 in it I cant able to find hooks in (node-modules->paw-js). Can you please help me with this issue

from react-pwa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.