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.

Custom Servers + BYO `express` cleanup tasks

See original GitHub issue

A master-list of tasks to do after #1109 lands.

  • Stop hard-coding the admin path on static build
  • Rename all the paths to routes (to be consistent with the StaticApp API of accepting a route (the URL) and a path (local file system).
    • Change FileAdapter API from { route, directory } -> { path, src } to match everything else. #1644

  • Get the build() step working for static assets.
  • Rename options for server-static to path for the URL portion, and src for the file-system portion.
  • Add more tests for the different edge cases of the prepare method + CLI (currently written as test.todo() in the code as placeholders) #1109
  • Remove keystone from @keystone-alpha/app-admin’s constructor (it’s passed into the prepareMiddlewares() function. #1197
  • There is a port parameter being passed to prepareMiddleware() which is only used for some console.logs. I want to move all that into the default server and stop passing the port parameter. #1203
  • Most of the custom servers now only exist to insert default data. Can we provide a better API for that which is setup in index.js, or (better yet) is a separate script that is run only once? This would make most of our custom servers go away leaving us with a nice clean index.js everywhere.
    • Provide an alternate mechanism for running things after connect (#1200)
    • Remove the custom servers (#1204)
  • This new structure makes it easier to start listening to requests immediately rather than waiting for all of KS to be ready + the AdminUI, etc. We can avoid the bad DX of having to hit F5 constantly until it boots up. (#1205)
  • ~Move the default server into its own file default-server.js so it’s easier to reference / discover for app developers.~ The default server is now heavily customised and might actually be confusing for devs, so I wont be doing this.
  • Documentation #1214
    • The expected API for servers.
    • Different ways to specify servers:
      • Export the servers array from index.js
      • Create a custom server.js and export the servers array from index.js
      • Create a custom server.js which instantiates all of its own middlewares
    • How to customise the GraphQL middleware (it’s just another server 😉)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jesstelfordcommented, May 21, 2019

@jed see #1205 - it should work for any app (because it happens before they’re initialised)

0reactions
MadeByMikecommented, Sep 17, 2019

Current PRs will resolve all outstanding issues here

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cleanup Submitted Tasks Tab - TechDocs - Broadcom Inc.
Specifies the minimum age of tasks that are in a final state (Completed, Failed, Rejected, Cancelled, or Aborted) to clean up.
Read more >
SCCM WSUS Cleanup – Fix SCCM Scan Timeout Errors
Let's see how to perform SCCM WSUS Cleanup and FIX SCCM Scan Timeout Errors. This post will help you FIX the SCCM WSUS...
Read more >
Server Sidework Checklist - w/ Template! - WebstaurantStore
Cleaning Duties For Servers​​ Some cleaning responsibilities include the following: Sanitizing surfaces. Sweeping and vacuuming.
Read more >
Clean Up WSUS the Easy Way - xenappblog
Clean Up WSUS Content Folder and Reclaim your VMFS datastore. Step-by-step instructions and awesome script to reset and save 70% download.
Read more >
Maintaining Your Databases on SQL Server Express Edition
Database- database(s) to BE INCLUDED IN MAINTENANCE TASKS (REQUIRED) ; LOG, Transition log backup ; DIFF, Differential backup ; CHECKDB, Integrity check ;...
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