question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build a custom server

See original GitHub issue

Feature

Custom server

Why is this feature being added?

The custom server will be needed for juicy SEO benefits.

As it stands, we cant just throw files into static and have it be immediately routable on the server.

With a custom server, we can add routes that point to static files for crawlers (example: robots.txt)

This issue explains further.

What should your feature do?

Something similar to this in <rootDir>/server.js

Warning, do not copy-paste:

const robotsOptions = {
  root: __dirname + '/static/',
  headers: {
    'Content-Type': 'text/plain;charset=UTF-8',
  }
};
server.get('/robots.txt', (req, res) => (
  res.status(200).sendFile('robots.txt', robotsOptions)
));

const sitemapOptions = {
  root: __dirname + '/static/',
  headers: {
    'Content-Type': 'text/xml;charset=UTF-8',
  }
};
server.get('/sitemap.xml', (req, res) => (
  res.status(200).sendFile('sitemap.xml', sitemapOptions)
));

const faviconOptions = {
  root: __dirname + '/static/'
};
server.get('/favicon.ico', (req, res) => (
  res.status(200).sendFile('favicon.ico', faviconOptions)
));

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sethbergmancommented, Nov 13, 2018

Thanks @kylemh I have been busy working at Dell. I made this issue before I started, and I’m going to open it up for other contributors. I apologise for the late response @dmarchante.

1reaction
kylemhcommented, Oct 28, 2018

@ssiddhantsharma he was making an issue for himself to resolve. Consider this work assigned 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build & Configure Your Own Server Online - ETB Tech
Are you looking to build your own server? ETB Tech has a wide range of configurable servers in stock. You can configure and...
Read more >
How to build a rack-mounted server from scratch
How to build a rack-mounted server from scratch · 1) Buy a server from the big guys · 2) Buy a server from...
Read more >
How To Build a Server and How Much Will it Cost? - Techjury
To create your own server, you need: CPU; Motherboard; RAM; Hard Drive; Cooling; Chassis; Power supply; Graphics card (Optional); DVD Drive (Optional). Aside ......
Read more >
Configure a Custom Server | Puget Systems
Customize a Puget Systems rackmount server for your specific needs. Our custom configuration tool lets you pick the parts and specs you want....
Read more >
Build Your Own Server - Custom Server - Aventis Systems
Build your own server to fit your needs today. This allows you to pick and choose what you want and need to best...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found