mozilla-services / Dockerflow

Cloud Services Dockerflow specification
Apache License 2.0
195 stars 28 forks source link

Convert sample app to express framework #54

Closed sciurus closed 4 years ago

sciurus commented 4 years ago

Express is the most commonly used severside javascript framework in use at Mozilla AFAICT,, so it is a better starting point for a sample app.

$ docker run -p 127.0.0.1:8000:8000/tcp c97a23679442 &
[1] 92532
$ 
> Dockerflow@0.0.1 start /app
> node server.js

{"Timestamp":1588948237539000000,"Logger":"dockerflow-demo","Type":"general.server","Severity":6,"Pid":17,"EnvVersion":"2.0","Fields":{"msg":"listening","port":"8000"}}

$ curl localhost:8000/__heartbeat__
{"status":"ok","checks":{"version_file_exists":"ok"},"details":{}}
jvehent commented 4 years ago

Express is the most commonly used severside javascript framework in use at Mozilla

Is this true? I know taskcluster and fxmonitor use it, but fxa uses hapi and tons of apps use python with either flask or django. 🤷‍♂️

sciurus commented 4 years ago

Before doing this I poked around the FXA repo and saw it using express as well. Probably they use both.

Definitely agree lots of app use Python. I think I saw you do some work on a sample dockerflow-compliant app for that. Do you want to PR a reference to it here?

Truthfully I kinda like the idea of splitting the sample nodejs app out into its own repo so that this repo includes just the standard, and then linking to both it and the python example app from here. As part of that, the node app could also be improved to be better structured and demonstrate additional best practices like Sentry integration etc. That's not work I'm volunteering for, though.

My goal here was just to take the existing sample app and get it in better shape so that someone building a very simple app might be able to actually use it as a starting point.