LoginSignup
0
0

More than 5 years have passed since last update.

Windows Azure モバイルサービスでNode.jsのモジュール(npm)を使う方法

Last updated at Posted at 2014-01-16

概要

  • モバイルサービス内のスクリプトでNode.jsのモジュールを使えるようにします。

手順

1.ソース管理を有効にする

  • モバイルサービスのダッシュボードから「ソース管理の設定」をクリック。
  • GitのID/PW設定画面が表示されるので、ID/PWを登録する。
  • モバイルサービスの構成に「ソース管理」という項目が追加され、GitのURLが表示される

2.Gitでnpmをpushする

  • まずローカル環境にgit cloneする。
git clone <GitのURL>
  • ID/PWを求められるので、設定した値を入力する。
  • git cloneしたディレクトリの<サービス名>/Serviceに移動し、node_modulesフォルダを作成する。
cd <サービス名>/Service
mkdir node_modules
  • ローカルリポジトリにNode.jsのモジュールをインストールする。
npm install <パッケージ名>
  • git addgit commitする。
git add node_modules/
git commit -m “added node_modules”
  • モバイルサービスのリポジトリにgit pushする。
  • リモートリポジトリはorigin、ブランチはmasterがデフォルトの状態。
git push origin master

3.サーバスクリプトから利用する

  • 標準的なnpmの使い方で使えます。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0