我正在开发一个 Angular 8 应用程序,它将使用 JWT 令牌身份验证登录到 .Net Core Rest API。
当我启动应用程序时,应用程序编译成功,没有错误。但是,当我打开http://localhost:4200 时,会出现一个空白页面。
这是app-routing.module.ts文件:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './login';
import { HomeComponent } from './home';
import { AppComponent } from './app.component';
import { AuthGuard } from './_helpers';
const routes: Routes = [
{path: '',component:AppComponent,canActivate: [AuthGuard]},
{path:'login',component:LoginComponent},
{path: '**',redirectTo:''}
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Run Code Online (Sandbox Code Playgroud)
这是app.component.ts文件: …
我使用golang开发了一个rest api。我已将存储库推送到Heroku。我还在互联网上托管了一个Mysql服务器。Go rest api连接到Mysql服务器并获取和插入数据。
heroku 上的应用程序昨天工作正常。但是今天早上我在“heroku log --tail”上收到此错误:Web 进程无法在启动后 60 秒内绑定到 $PORT
这是 main.go 的代码:
package main
import (
"os"
"github.com/mingrammer/go-todo-rest-api-example/app"
"github.com/mingrammer/go-todo-rest-api-example/config"
)
func main() {
config := config.GetConfig()
app := &app.App{}
app.Initialize(config)
port, ok := os.LookupEnv("PORT")
if ok == false {
port = "3000"
}
app.Run(":"+port)
}
Run Code Online (Sandbox Code Playgroud) 我在Gradle 5.1.1中使用了Intellij Idea,我想刷新Gradle项目,但是在刷新项目时收到错误消息:
错误:在Gradle 5.0中删除了对使用版本低于3.0的工具API的客户端的支持。您当前正在使用工具API 2.9版。您应该将工具API客户端升级到3.0或更高版本。
我该怎么办?