DEV Community

An enterprise-style Node.js REST API setup with Docker Compose, Express and Postgres

Hugo Di Francesco on April 24, 2019

The why and how of enterprise-style Node.js application. A setup that’s easy to test and extend using battle-hardened technologies like Express.js,...
Collapse
 
tiim profile image
Tim Bachmann

Is there a specific reason you use npm install as opposed to npm ci? The ci command has the advantage that it installs the exact versions that are specified in package-lock.json so your get repeatable builds.

Collapse
 
hugo__df profile image
Hugo Di Francesco • Edited

Definite oversight on my part 🙂 thanks for pointing it out

Collapse
 
antonioavelar profile image
António Avelar

Hi Hugo,
the way you specified your queries (with template strings), doesn't make your vulnerable to db attacks like SQL Injection?

I also noticed that in order to specify the querie with template strings you used an external lib. That lib just translates the template string into a prepared statement, right?

Collapse
 
hugo__df profile image
Hugo Di Francesco

Yes it does, ergonomics of templates with prepared statements.

Collapse
 
theodesp profile image
Theofanis Despoudis

It’s best if you use Typescript and pg-promise as they are more enteprise-like choices

Collapse
 
hugo__df profile image
Hugo Di Francesco

Re TypeScript I didn't want to add a build step in.

Pg-promise I just picked any old Postgres client they're all pretty solid.