我有关于nodemon的--exec参数的问题.在这篇文章(http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/)之后,我尝试用NPM设置我的开发环境,但nodemon拒绝为我提供服务节点服务器,当我把--exec参数.
我在package.json中的脚本:
"scripts": {
"clean": "rimraf src/app/build/app.bundle.js",
"build": "browserify src/app/scripts/app.js > src/app/build/app.bundle.js",
"serve": "nodemon server.js --ignore src/app/build --exec \"npm run build\"",
"cbs": "npm run clean && npm run build && npm run open && npm run serve",
"open:dev": "opener http://localhost:9000",
},
Run Code Online (Sandbox Code Playgroud)
这就是我在我的git bash中得到的:
poc-js-pdf@0.0.1 serve C:\Users\Mdeumie\Projets\Archi\poc-js-pdf
nodemon server.js --ignore src/app/build --exec "npm run build"
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `npm run build server.js`
poc-js-pdf@0.0.1 build C:\Users\Mdeumie\Projets\Archi\poc-js-pdf
browserify src/app/scripts/app.js …Run Code Online (Sandbox Code Playgroud) 我需要为 ckeditor 创建一个自定义插件,以允许用户创建一个 cutom html a 元素。
我设法在小项目上创建了这个插件,包括我在 ckeditor 示例中的脚本元素中的代码(如下:https ://ckeditor.com/docs/ckeditor5/latest/framework/guides/tutorials/implementing-an-inline-小部件.html)。一切还好。
但我的问题是在我的 Angular 应用程序中包含该插件。我不明白如何导入它。
我尝试了许多不同的方法来导入由 webpack 生成的构建的 ckeditor.js 文件,但从未奏效...
所以我的主要问题是我不明白如何从简单的项目中使用我的插件生成构建以将其导入我的 Angular 应用程序中..
谢谢,如果有人有解决这个问题的想法??
我的angularJS应用程序(在localhost:9000上)尝试捕获我的节点服务器(在localhost:9001上)时遇到了经典的CORS问题
这里我的休息api(app.js)代码:
var cors = require('cors');
app.use(cors());
app.options('*', cors());
app.all('/*', function(req, res, next) {
// CORS headers
res.header("Access-Control-Allow-Origin", "*");
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header("Access-Control-Allow-Headers", "X-Requested-With, Content-Type");
if (req.method == 'OPTIONS') {
res.status(200);
res.write("Allow: GET,PUT,POST,DELETE,OPTIONS");
res.end();
} else {
next();
}
});
Run Code Online (Sandbox Code Playgroud)
如你所见,我已经尝试了这些解决方案:
这是webapp中简单的$ http调用:
var req = {
method: 'GET',
url: 'localhost:9001/memories'
};
$http(req).
success(function(data, status, headers, config) {
// this callback will be called asynchronously
// when the response is available
reutrnStatus.success = true;
reutrnStatus.msg = status;
memories …Run Code Online (Sandbox Code Playgroud)