Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Separate out concerns in app.js

Open
#146 0 comments 0 reactions 1 assignee View on GitHub

@sima-qian is already working on this.

Since Oct 19, 2018.

Assessment

This issue has not been assessed yet.

Description

server

Each of your handlers in app.js is doing quite a bit while database.js is only wrapping Airtable.

A good practice is to try and expose as little as possible of each bit of your app. So e.g. app.get("/api/get-station/:station" would be responsible for validating that station is a valid parameter and then it would call database.getStation(station) and returning either JSON or a useful error. Within the database module you'd have functions that would access the various things from Airtable.

This means that the server is only responsible for communicating with the client and all of the business logic is separate. Ideally the business logic shouldn't 'know' that it's in a web server. This also means you can change database or web server without having to rewrite everything.

Dominant language
JavaScript
Stars
4
Forks
2
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fac-14/OSCEBossKey

All issues in fac-14/OSCEBossKey

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.