如何在PC上将当前的node.js开发设置部署到物理ubuntu服务器上?

时间:2019-08-05 01:58:00

标签: linux web-applications server

我现在在我的笔记本电脑上开发了一个带有rest api的node.js服务器应用程序,显然我可以在我的笔记本电脑上通过网络http://localhost看到该应用程序。现在,我正在尝试将此后端服务器部署到物理linux服务器计算机上,以进行进一步的开发。我将通过ssh在该物理服务器上进行测试,并且我已经git将项目克隆到了Linux服务器中。因此,现在如何设置它使其能够在笔记本电脑上查看Web上的http响应(因为当前我仅测试@locahost)?另外,如何将POSTMAN等api开发应用程序与笔记本电脑中的物理服务器一起使用?

谢谢。

1 个答案:

答案 0 :(得分:-1)

首先,根据您的评论,我们知道您的服务器已安装apache,因此,导航到[RequireComponent(typeof(UnityEngine.Video.VideoPlayer))] public class MyVideoPlayer : MonoBehaviour { [SerializeField] private System.Collections.Generic.List<UnityEngine.Video.VideoClip> videoClips = null; private UnityEngine.Video.VideoPlayer videoPlayer = null; private IEnumerator playEnumerator = null; public void VideoPlay(int num) { Application.runInBackground = true; playEnumerator = VideoPlayCoroutine(num); StartCoroutine(playEnumerator); } public void VideoStop() { videoPlayer.Stop(); if (playEnumerator != null) { StopCoroutine(playEnumerator); } } private System.Collections.IEnumerator VideoPlayCoroutine(int num) { videoPlayer = GetComponent<UnityEngine.Video.VideoPlayer>(); Debug.Assert(videoClips.Count > num); Debug.Assert(videoClips[num] != null); videoPlayer.clip = videoClips[num]; videoPlayer.Prepare(); while (!videoPlayer.isPrepared) { Debug.Log("Preparing Video"); yield return null; } Debug.Log("Done Preparing Video"); videoPlayer.Play(); while (videoPlayer.isPlaying) { yield return null; } Debug.Log("Played Successfully!!"); } } 时看到的页面应该是位于http://[server IP]的{​​{1}}文件。这可能是您要放置克隆文件的地方。浏览器无法访问index.html文件夹之上的任何内容。

当然您需要安装/var/www/html/。如果尚未安装,请通过html/使用:

  

sudo apt-get install nodejs

也许您需要安装其他东西,例如POSTMAN,但是您会发现在ubuntu上安装东西确实很容易,并且在网络上有很好的记录。

相关问题