Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate and uplift provider code #64

Open
TimothyJones opened this issue Nov 15, 2021 · 2 comments
Open

Separate and uplift provider code #64

TimothyJones opened this issue Nov 15, 2021 · 2 comments

Comments

@TimothyJones
Copy link
Contributor

While discussing this issue, I noticed that the provider startup code is included in the test file.

// Setup provider server to verify
const app = express();
app.use(apiRoutes);

const server = app.listen('8080');

The example would be clearer if we pulled it out to a file that exports a start() function or similar, highlighting that the server is the application, rather than a separate bit of code that only lives at test time.

While we're there:

  • The port number in that method signature is a number, not a string (although I don't think it matters)
  • We could also modernise the JS at the same time (es6 imports, maybe typescript, not doing Object.assign, etc).
@mefellows
Copy link
Member

Thanks, yes that was something that should've been done a while back. I did actually do it in one of the replicants of this project, but can't see where. It's not hard, just needs to be fed back into all steps though.

An update to support newer languages makes sense also.

@YOU54F
Copy link
Member

YOU54F commented Oct 3, 2023

The example would be clearer if we pulled it out to a file that exports a start() function or similar, highlighting that the server is the application, rather than a separate bit of code that only lives at test time.

110% agree with this, I didn't get to tackle it on this round of the workshop updates (wanted to get every step at least resynchronised but this is on my radar)

Thank you for illustrating a really valid point that we want to starting and testing the code we would run in production, and not just some test time representation of the provider (which itself could drift!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants