K
K
krytPhylosoph2020-08-31 17:46:26
Express.js
krytPhylosoph, 2020-08-31 17:46:26

Access to statics only via API?

Now I am writing an API on nodejs. The bottom line is that there are statics (images) on the server. Of course, you can access it by URL (localhost:3000/static/bla-bla-bla.jpg). I need to be able to access the statics only through the API. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
McBernar, 2020-08-31
@McBernar

Using the API, you can get either the url of this file (as a text) or a blob, but then you can store the original data stream anywhere outside the static folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question