問題タブ [grunt-contrib-connect]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
angularjs - How to specify a variable for an AngularJS app as a command line parameter when starting a Grunt dev server (grunt-contrib-connect)
In my production environment the Angular app is served under the same domain as the API therefore the base url is in the form of e.g. '/api'.
The problem is when I develop I'm using grunt serve (grunt-contrib-connect) as my development server and I would like to specify a base url for the API Endpoint when I start it e.g. grunt serve --endpoint="http://localhost/api"
I know I can get this value using grunt.option however, I don't know how to pass this along to my Angular App.
Note: this is not your typical production/development config split. I want the endpoint to be specified every time the development server is started.
Any solutions? The simpler the better!
javascript - うなり声で URL を書き換える
URLを変更する必要があるアプリがあります。たとえば、次のようlocalhost:9000
になりますlocalhost:9000/myapp
すべての静的ファイルには、html のような url がありますmyapp/style/main.css
。しかし、実際のmyapp
フォルダーには存在しません。URLで表示するだけです。内部的に書き換える方法がわかりません。
サーバーは"grunt-contrib-connect"
javascript - javascript トークン '\' の無効な正規表現
完全なパス内の単語に一致し、ポイント文字を含まない URL を見つけるために、次の正規表現を作成しました。
https://www.regex101.com/#javascriptで動作しますが、この接続タスクを定義すると、接続タスクのうなり声で動作します。
私はこのエラーを受け取りました: Invalid regular expression: /(home?*)([^.]*)$/: Nothing to repeat
IDE は 'path ' 単語の間の 2 つのスラッシュ (\path\ ) で私に警告します。
これらのスラッシュを使用できるのはなぜですか? これらのスラッシュを置き換えるために何を使用できますか? どうもありがとう
angularjs - grunt-contrib-connect で NetBeans デバッガをどのように使用しますか?
Yeoman Angular ジェネレーターから生成されたプロジェクトがあります。WebStorm では、デバッグの前に「grunt serve」を実行するようにプロジェクトをセットアップすると、すべてが機能します。これを NetBeans で試してみると、コードがブレークポイントで停止しません。NetBeans で grunt-contrib-connect から提供されたコードをデバッグすることは可能ですか?
docker - docker コンテナ内で grunt-connect を実行する方法
localhost:8080
ドッカーコンテナでノード接続(grunt-contrib-connect)Webサーバーを実行しているGruntがあります。次のコマンドでコンテナーを実行します:
$ docker run --rm -it -p 8080:8080 js1972/yeoman:v3
.
コンテナ内で、grunt connect タスクを で実行しgrunt develop
ます。
私はMacを使用しているので、boot2dockerを使用しています。boot2docker ip
ホストの IP は 192.168.59.103 と表示されているので、ブラウザでhttp://192.168.59.103:8080を使用して接続サーバーにアクセスする必要があります。
ただし、これは機能せず、サファリがサーバーに接続できないというメッセージが表示されます。(Docker Web サイトの例のように単純な Python Web サーバーを使用すると、ポート転送が正常に機能することに注意してください。)
ここで何が問題なのですか?同じプロセスは、docker の外でも完全に機能します。localhostでConnectを実行することに関係があると感じています。--add-hosts と -p localhost:8080:8080 などのさまざまな組み合わせを試しましたが、役に立ちませんでした...
それが役立つ場合は、私の docker ファイルと gruntfile: https://dl.dropboxusercontent.com/u/7546923/Dockerfile https://dl.dropboxusercontent.com/u/7546923/Gruntfile.js
よし、ジェイソン。
javascript - grunt-contrib-connect - 致命的なエラー: getaddrinfo ENOTFOUND my.website - カスタム URL を設定するには?
grunt-contrib-connect
特定の URL の下にサーバーを作成するために使用したいと思いますhttp://my.website/
。ドキュメントによると、私がする必要があるのはhostname
オプションを変更することだけですが、次のようなエラーが表示され続けますFatal error: getaddrinfo ENOTFOUND my.website
。
これが私のものGruntfile.js
です:
ありがとう。
gruntjs - Grunt connect がテストできるほど長く生きていない
Grunt を使用してサーバーを作成しようとすると、すぐにシャットダウンし、ブラウザーに移動してテストするための変更が行われません。
これは私の Grunt ファイル全体です。
実行すると、エラーなしで動作します。