.NET 6에서 GraphQL 시작하기 - 4부(추가 - Azure 웹 앱에 배포)
2807 단어 graphqlazureazurewebappdotnet
동영상
메모
BE 코드
<ItemGroup>
<!-- other dependencies... -->
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0" />
<!-- other codes ... -->
</ItemGroup>
Program.cs
를 업데이트합니다.// Add services to the container.
builder.Services.AddDbContext<NotesContext>(options =>
{
// options.UseSqlServer(builder.Configuration.GetConnectionString("Default"));
options.UseInMemoryDatabase("NotesTest");
});
FE 코드
index.tsx
에서 백엔드(GraphQL) URL을 업데이트합니다. 하드 코딩 대신 환경을 사용하도록 업데이트할 수 있으므로 빌드 단계에서 URL을 설정할 수 있습니다.// other codes
const client = new ApolloClient({
uri: 'https://graph-api-demo.azurewebsites.net/graphql',
cache: new InMemoryCache()
});
// other codes
고맙습니다
Reference
이 문제에 관하여(.NET 6에서 GraphQL 시작하기 - 4부(추가 - Azure 웹 앱에 배포)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/berviantoleo/getting-started-with-graphql-in-net-6-part-4-extra-deploy-to-azure-web-app-1on4텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)