A
A
armor2018-08-28 11:49:02
Node.js
armor, 2018-08-28 11:49:02

How to use shared files in Node.js projects?

Good afternoon, there are two projects: a website and api for the application, I don’t want to combine them. How can I move the model files so that they can be used both there and there? If you take them out to a higher level of projects, the models swear on dependencies. there is no node_modules folder.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
RidgeA, 2018-08-28
@RidgeA

move to a separate repository

A
Anubis, 2018-08-28
@Anubis

- src
-- app
-- server
The server can have access to the application files and include them, but not vice versa
The common folder is superfluous here IMHO

D
Dmitry Belyaev, 2018-08-28
@bingo347

https://git-scm.com/book/ru/v1/%D0%98%D0%BD%D1%81%...
Take it to a separate repo, connect it as a git submodule
PS You have seriously common business logic on the client and server?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question