我想使用NPM部署我的NodeJS + ExpressJS网站(API rest + front)。
我现在在做什么:
在第4步之后。我有以下文件树:
my-software
├── bin.js
├── package.json
├── src
└── node_modules
├── some-required-module
│ ├── HISTORY.md
│ ├── index.js
│ ├── LICENSE
│ ├── package.json
│ └── README.md
我不喜欢这个文件树,因为一切都是同一级别:我的软件及其依赖性,它使它非常混乱。 我喜欢这样:
protected void onStart() {
super.onStart();
//Build resources if null
if (settings == null) {
settings = getSharedPreferences(PREFS_NAME, 0);
}
Boolean RequestingLU = settings.getBoolean("RequestingLU", true);
if (!RequestingLU) {
StoppedMessage();
}
if (RequestingLU) {
if (mLocationClient == null)
{
buildLocationClient();
}
mLocationClient.connect();
}
}
public void onConnected(Bundle connectionHint) {
Toast.makeText(this, "You have connected", Toast.LENGTH_LONG).show();
mLocationRequest = new LocationRequest();
mLocationRequest.setInterval(UPDATE_INTERVAL);
mLocationRequest.setFastestInterval(UPDATE_INTERVAL);
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
PendingResult<LocationSettingsResult> result =
LocationServices.SettingsApi.checkLocationSettings(mLocationClient, mLocationSettingsRequest
);
result.setResultCallback(ViewingWindow.this);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
LocationServices.FusedLocationApi.requestLocationUpdates(mLocationClient, mLocationRequest, this);
OldLocation = LocationServices.FusedLocationApi.getLastLocation(mLocationClient);
}
}
public void onLocationChanged(Location location) {
Toast.makeText(this, "Location Changed", Toast.LENGTH_SHORT).show();
if (settings == null) {
settings = getSharedPreferences(PREFS_NAME, 0);
}
double speed = OldLocation.distanceTo(location);
OldLocation = location;
}
有没有办法将npm软件包安装为项目,因此有文件树我喜欢?