node.js - How to Setup API Environment in Node -
i'm building node.js rest api. have repository hold rest api code.
i want able test api. i'll test via express , make requests start want express stuff in separate project because rest api isn't gonna have web app portion.
i'm using webstorm. right have created github repo hold api i'll expose rest endpoints.
i want create new project again node-express project purpose of pulling in rest api , consume it. doing in seperate project because don't want express stuff checked rest api repo, doesn't belong there. using express testing stuff.
i realize can later test rest endpoints headless, right wanna started , figure out later , going express project somehow consume other api rest project.
i'm not quite sure on few things, come .net enviornment , no longer .net developer. here questions have:
my question: if have node express project open in webstorm, how "include" or "require" rest-api? somehow npm down? rest api not public. branch git rest api repo down, what? how include seperate express app project?
or...do people still add express rest api projects anyway, maybe doesn't matter?
you can use npm link
link local package
$ cd main-project $ npm link ../path/to/web-api
then in main project, can require
other module
if don't intend on publish it, package.json in web-api should have
{ "private": true }
Comments
Post a Comment