SEO: Detect search engine and provide server-side generated HTML from JavaScript

Hey, I’m creating a WebSocket based page. I want to optimise it for SEO.
What I need is a Plug that catch requests from search engines and a best way to render page server-side.

  1. Is there any hex package that provide this plug with configurable callback?
  2. What is the best JavaScript server-side parser? What I want is to fetch API data from WebSocket connection and render it in plain JavaScript.
    From this table I can see that best (in support new JavaScript features) is Node 6.5. I know Phoenix supports it for generate JavaScript files, but is there any tutorial to use Node as server-side client that responds rendered page to a search engine?
  3. Is there any way to detect (from JavaScript) if page is rendered by Node? What I want is just load page content (for example: article title, body etc.) without any Notifications and other real client web technologies.
  1. No but that is a fairly trivial test, just get a list of user agents you want it to detect then just have a plug or the page itself return something different.
  2. Node, just access it like any other program via a Port. :slight_smile:
  3. Yes, multiple ways, for example its global object is different, in addition to other calls you can explicitly test for, or special packages like ‘fs’ or so.