Node.js npm/业力开始http://localhost:8000/index.html 404错误
我有一个角度1.5的应用程序,是类似的,它的工作很好。现在,当我实现单元测试时,我加载karma.conf文件中所需的适当文件,然后使用Node.js npm/业力开始http://localhost:8000/index.html 404错误,node.js,npm,karma-runner,karma-jasmine,npm-start,Node.js,Npm,Karma Runner,Karma Jasmine,Npm Start,我有一个角度1.5的应用程序,是类似的,它的工作很好。现在,当我实现单元测试时,我加载karma.conf文件中所需的适当文件,然后使用npm start启动节点服务器,然后我进入浏览器并访问http://localhost:8000我可以在karma.conf中看到指定目录的目录结构,但我无法浏览到index.html文件,当我尝试时,会出现404错误 相反,当我使用angular phonecat应用程序执行相同操作时,我可以在浏览时查看index.html文件http://localhos
npm start
启动节点服务器,然后我进入浏览器并访问http://localhost:8000
我可以在karma.conf中看到指定目录的目录结构,但我无法浏览到index.html文件,当我尝试时,会出现404错误
相反,当我使用angular phonecat
应用程序执行相同操作时,我可以在浏览时查看index.html
文件http://localhost:8000
这是我的karma.conf文件:
//jshint strict: false
module.exports = function(config) {
config.set({
basePath: '',
files: [
'scripts/angular/angular.min.js',
'scripts/angular/angular-route.min.js',
'scripts/angular/angular-ui-router.min.js',
'app/weatherApp.js',
'app/weather-app/modules/weather/weatherModule.js',
'app/weather-app/modules/weather/weatherService.js',
'app/weather-app/modules/weather/weather-controller.js',
'app/weather-app/modules/weather/weatherService.spec.js'
],
autoWatch: true,
frameworks: ['jasmine'],
browsers: ['Chrome', 'Firefox'],
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-jasmine'
]
});
};