veliovgroup / spiderable-middleware

🤖 Prerendering for JavaScript powered websites. Great solution for PWAs (Progressive Web Apps), SPAs (Single Page Applications), and other websites based on top of front-end JavaScript frameworks
https://www.npmjs.com/package/spiderable-middleware
BSD 3-Clause "New" or "Revised" License
36 stars 4 forks source link

how can implement in angular js #3

Closed verishal closed 6 years ago

verishal commented 6 years ago

how to add spiderable-middleware metor.js file in angulor js .?

dr-dimitru commented 6 years ago

Hello @verishal ,

What do you use for server routing? For example we have code sample for express library (express is one of the most popular solutions).

verishal commented 6 years ago

No. we have code in sample phantom js.how can do it? server rounting.

dr-dimitru commented 6 years ago

Hello @verishal ,

verishal commented 6 years ago

Hello @dr-dimitru just i have use phantom js.

dr-dimitru commented 6 years ago

@verishal what do you use as server? Apache? Nginx? Phusion?

verishal commented 6 years ago

@dr-dimitru i have use a Apache server.

dr-dimitru commented 6 years ago

@verishal okay, we haven't yet published official Apache integration config. Here is one of my snippets, please try it, and report if it works well for you, replace _YOUR_AUTH_TOKEN_ with token found under nginx integration tab:

<IfModule mod_headers.c>
  ########
  # Do not forget to change _YOUR_AUTH_TOKEN_ to token you get from ostr.io
  ########
  RequestHeader set Authorization "Basic _YOUR_AUTH_TOKEN_"
</IfModule>

<IfModule mod_rewrite.c>
  RewriteEngine On
  <IfModule mod_proxy_http.c>
    RewriteCond %{HTTP_USER_AGENT} \.net\ crawler|360spider|50\.nu|8bo\ crawler\ bot|aboundex|accoona|adldxbot|adsbot-google|ahrefsbot|altavista|appengine-google|applebot|archiver|arielisbot|ask\ jeeves|auskunftbot|baidumobaider|baiduspider|becomebot|bingbot|bingpreview|bitbot|bitlybot|blitzbot|blogbridge|boardreader|botseer|catchbot|catchpoint\ bot|charlotte|checklinks|cliqzbot|clumboot|coccocbot|converacrawler|crawl-e|crawlconvera|dataparksearch|daum|deusu|developers\.google\.com/+/web/snippet|discordbot|dotbot|duckduckbot|elefent|embedly|evernote|exabot|facebookbot|facebookexternalhit|fatbot|fdse\ robot|feed\ seeker\ bot|feedfetcher|femtosearchbot|findlinks|flamingo_searchengine|flipboard|followsite\ bot|furlbot|fyberspider|gaisbot|galaxybot|geniebot|genieo|gigablast|gigabot|girafabot|gomezagent|gonzo1|google\ sketchup|google-structured-data-testing-tool|googlebot|haosouspider|heritrix|holmes|hoowwwer|htdig|ia_archiver|idbot|infuzapp|innovazion\ crawler|instagram|internetarchive|iqdb|iskanie|istellabot|izsearch\.com|kaloogabot|kaz\.kz_bot|kd\ bot|konqueror|kraken|kurzor|larbin|leia|lesnikbot|linguee\ bot|linkaider|linkapediabot|linkedinbot|lite\ bot|llaut|lookseek|lycos|mail\.ru_bot|masidani_bot|masscan|mediapartners-google|metajobbot|mj12bot|mnogosearch|mogimogi|mojeekbot|motominerbot|mozdex|msiecrawler|msnbot|msrbot|netpursual|netresearch|netvibes|newsgator|ng-search|nicebot|nutchcvs|nuzzel|nymesis|objectssearch|odklbot|omgili|oovoo|oozbot|openfosbot|orangebot|orbiter|org_bot|outbrain|pagepeeker|pagesinventory|parsijoobot|paxleframework|peeplo\ screenshot\ bot|pinterest|plantynet_webrobot|plukkie|pompos|psbot|quora\ link\ preview|qwantify|read%20later|reaper|redcarpet|redditbot|retreiver|riddler|rival\ iq|rogerbot|saucenao|scooter|scrapy|scrubby|searchie|searchsight|seekbot|semanticdiscovery|seznambot|showyoubot|simplepie|simpy|sitelockspider|skypeuripreview|slack-imgproxy|slackbot|slurp|snappy|sogou|solofield|speedy\ spider|speedyspider|sputnikbot|stackrambler|teeraidbot|teoma|theusefulbot|thumbshots\.ru|thumbshotsbot|tineye|toweya\.com|toweyabot|tumblr|tweetedtimes|tweetmemebot|twitterbot|url2png|vagabondo|vebidoobot|viber|visionutils|vkshare|voilabot|vortex|votay\ bot|voyager|w3c_validator|wasalive\.bot|web-sniffer|websquash\.com|webthumb|whatsapp|whatweb|wire|wotbox|yacybot|yahoo|yandex|yeti|yisouspider|yodaobot|yooglifetchagent|yoozbot|yottaamonitor|yowedo|zao-crawler|zebot_www\.ze\.bz|zooshot|zyborg [NC,OR]
    RewriteCond %{QUERY_STRING} _escaped_fragment_

    RewriteRule ^(?!.*?(\.(?:3ds|3g2|3gp|3gpp|7z|a|aac|aaf|adp|ai|aif|aiff|alz|ape|apk|appcache|ar|arj|asf|asx|atom|au|avchd|avi|bak|bbaw|bh|bin|bk|bmp|btif|bz2|bzip2|cab|caf|cco|cgm|class|cmx|cpio|cr2|crt|crx|css|csv|cur|dat|deb|der|dex|djvu|dll|dmg|dng|doc|docm|docx|dot|dotm|dra|drc|DS_Store|dsk|dts|dtshd|dvb|dwg|dxf|ear|ecelp4800|ecelp7470|ecelp9600|egg|eol|eot|eps|epub|exe|f4a|f4b|f4p|f4v|fbs|fh|fla|flac|fli|flv|fpx|fst|fvt|g3|geojson|gif|graffle|gz|gzip|h261|h263|h264|hqx|htc|ico|ief|img|ipa|iso|jad|jar|jardiff|jng|jnlp|jpeg|jpg|jpgv|jpm|js|jxr|key|kml|kmz|ktx|less|lha|lvp|lz|lzh|lzma|lzo|m2v|m3u|m4a|m4p|m4v|map|manifest|mar|markdown|md|mdi|mdown|mdwn|mht|mid|midi|mj2|mka|mkd|mkdn|mkdown|mkv|mml|mmr|mng|mobi|mov|movie|mp2|mp3|mp4|mp4a|mpe|mpeg|mpg|mpga|mpv|msi|msm|msp|mxf|mxu|nef|npx|nsv|numbers|o|oex|oga|ogg|ogv|opus|otf|pages|pbm|pcx|pdb|pdf|pea|pem|pgm|pic|pl|pm|png|pnm|pot|potm|potx|ppa|ppam|ppm|pps|ppsm|ppsx|ppt|pptm|pptx|prc|ps|psd|pya|pyc|pyo|pyv|qt|ra|rar|ras|raw|rdf|rgb|rip|rlc|rm|rmf|rmvb|ron|roq|rpm|rss|rtf|run|rz|s3m|s7z|safariextz|scpt|sea|sgi|shar|sil|sit|slk|smv|so|sub|svg|svgz|svi|swf|tar|tbz|tbz2|tcl|tga|tgz|thmx|tif|tiff|tk|tlz|topojson|torrent|ttc|ttf|txt|txz|udf|uvh|uvi|uvm|uvp|uvs|uvu|vcard|vcf|viv|vob|vtt|war|wav|wax|wbmp|wdp|weba|webapp|webm|webmanifest|webp|whl|wim|wm|wma|wml|wmlc|wmv|wmx|woff|woff2|wvx|xbm|xif|xla|xlam|xloc|xls|xlsb|xlsm|xlsx|xlt|xltm|xltx|xm|xmind|xml|xpi|xpm|xsl|xwd|xz|yuv|z|zip|zipx)(?:\?[a-zA-Z0-9\-\.\_\~\:\/\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]*)?$))(.*) https://render.ostr.io/?url=%{REQUEST_SCHEME}://%{HTTP_HOST}/$2 [P,L]
  </IfModule>
</IfModule>
verishal commented 6 years ago

@dr-dimitru can you suggest me.which one _YOUR_AUTHTOKEN replace.

dr-dimitru commented 6 years ago

@verishal yes, from my message above, here:

RequestHeader set Authorization "Basic _YOUR_AUTH_TOKEN_"

Token should be taken from ostr.io, do you have an account there?

verishal commented 6 years ago

@dr-dimitru yes.

verishal commented 6 years ago

@dr-dimitru
i have open the side ostr.io .but did'nt see option the token key. how can get the token.? please @dr-dimitru suggest me.

dr-dimitru commented 6 years ago

@verishal

  1. See ostr.io docs
  2. Create an account, more info here
  3. Add and verify your server by IP or Domain Name
  4. Add prerendering to your server
  5. Click on "Integration Guide" go to "nginx" tab and pick "Authorization" header token
verishal commented 6 years ago

thank you. @dr-dimitru .

dr-dimitru commented 6 years ago

@verishal let me know once you make it work, or if you will have further questions.

verishal commented 6 years ago

ok Sure! @dr-dimitru .

verishal commented 6 years ago

@dr-dimitru , can i use apache server ?

dr-dimitru commented 6 years ago

@verishal , yes, the code in my comment above is for Apache

verishal commented 6 years ago

ok @dr-dimitru thank you for supporting.

dr-dimitru commented 6 years ago

Hello @verishal ,

Have you solved it? Doest it work well with Apache?

dr-dimitru commented 6 years ago

@verishal any news on this one?

verishal commented 6 years ago

yes. @dr-dimitru . i have implement . i tell you letter.if any regarding issue.thank you for supporting..me

dr-dimitru commented 6 years ago

@verishal great. Feel free to reopen it in case if the issue still persists on your end.