要准备部署到Heroku的Angular.js应用程序,可以按照以下步骤进行:
npm install -g @angular/cli
。这将允许你使用Angular CLI来创建和构建Angular应用程序。ng new my-app
。这将在当前目录下创建一个名为"my-app"的新项目。cd my-app
。ng serve
。这将在本地启动一个开发服务器,并在浏览器中打开应用程序。web: npm start
。这将告诉Heroku在部署应用程序时运行"npm start"命令。{
"name": "my-app",
"version": "0.1.0",
"scripts": {
"start": "ng serve",
"build": "ng build --prod"
},
"dependencies": {
"@angular/animations": "~12.0.0",
"@angular/common": "~12.0.0",
"@angular/compiler": "~12.0.0",
"@angular/core": "~12.0.0",
"@angular/forms": "~12.0.0",
"@angular/platform-browser": "~12.0.0",
"@angular/platform-browser-dynamic": "~12.0.0",
"@angular/router": "~12.0.0",
"rxjs": "~6.6.0",
"tslib": "^2.2.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular/cli": "~12.0.0",
"@angular/compiler-cli": "~12.0.0",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~8.3.0",
"tslint": "~5.17.0",
"typescript": "~4.2.0"
}
}
这将定义项目的依赖项和脚本。
请注意,以上步骤仅提供了一个基本的部署流程,具体的步骤可能因个人需求和项目配置而有所不同。此外,我无法提供腾讯云相关产品和产品介绍链接地址,因为这超出了我的能力范围。
领取专属 10元无门槛券
手把手带您无忧上云