Separate out concerns in app.js
@sima-qian is already working on this.
Since Oct 19, 2018.
Assessment
This issue has not been assessed yet.
Description
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fac-14/OSCEBossKey
-
Use destructuringMay be free again @Brymon claimed this 2903 days ago, and no pull request is open. Openquick-fix refactoring
fac-14/OSCEBossKey#158 · 1 assignee ·
-
ResultsContainerMay be free again @Brymon claimed this 2903 days ago, and no pull request is open. Openrefactoring
fac-14/OSCEBossKey#157 · 1 assignee ·
-
Folder structureOpen
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fac-14/OSCEBossKey#156 ·
-
Use functional components where possibleMay be free again @Brymon claimed this 2903 days ago, and no pull request is open. Openquick-fix refactoring
fac-14/OSCEBossKey#154 · 1 assignee ·
-
Double queryOpen
Difficulty 4/5 3-5 days Newbie friendliness 20/100
fac-14/OSCEBossKey#152 · 2 comments ·
All issues in fac-14/OSCEBossKey
Similar issues
-
新讀者走讀回報,照著一篇文章實際操作Opendocumentation good first issue help wanted
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
automated issue report
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lirantal/discoprint#29 ·
Maintainers usually reply within 1 day
-
feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
louislam/uptime-kuma#7914 · 1 comment ·
Maintainers usually reply within 1 day
-
Code Cleanup dependencies
Difficulty 1/5 Under an hour Newbie friendliness 68/100
ProjectSidewalk/SidewalkWebpage#5609 ·
Maintainers usually reply within 1 day
-
help wanted javascript
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OWASP/cornucopia#3538 ·
Maintainers usually reply within 1 day