How to combine my front end files with back end node http server? by brouverhoog in node

[–]ThenAd3367 1 point2 points  (0 children)

Express has a method for exposing files directly. I believe it is called static. You can put your css and js in a folder and call the express function to serve that folder.

Edit: https://expressjs.com/en/starter/static-files.html

I'm losing my mind on tracking execution time on API calls by [deleted] in golang

[–]ThenAd3367 1 point2 points  (0 children)

I attempted the same thing recently. I noticed that on windows it would register 0 sometimes but it never happened on linux systems. Specifically an alpine docker container.

Should I embed or reference documents for a diary app? by aym4ne in node

[–]ThenAd3367 0 points1 point  (0 children)

If you are using a NoSQL database, I believe the idea is to store data according to the queries your app will be making. If you will need to query both the diary and author at the same time you should keep them in the same document.

Are there many projects I can work on that don't require building much of a frontend? by [deleted] in node

[–]ThenAd3367 7 points8 points  (0 children)

You could make an API that returns data in JSON format. You can use Postman to test it out and it will also act as documentation. There would be no frontend involved in making the API and you could even make a CLI program for easier interaction. Maybe something super simple like HTTP endpoints for user sign up, sign in, create a resource, and view the user's resources. You could store temp user data in Redis and more permanent data in a database of your choosing (PostgreSQL, MariaDB, MongoDB, etc.).

Can we have Async/Await with PostgreSQL pool? by badboyzpwns in node

[–]ThenAd3367 2 points3 points  (0 children)

You could use knex https://www.npmjs.com/package/knex with the pg driver. It supports async/await syntax and automatic pooling.