This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddHealthChecks() | |
.AddUrlGroup(new Uri("https://login.microsoftonline.com"), "azure ad") | |
.AddUrlGroup(new Uri("https://graph.microsoft.com"), "graph api") | |
.AddSignalRHub(() => CreateSignalrHubConnection(healthCheckConfig["SignalR:Values"]), "signalr hub - values"); | |
services.AddHealthChecksUI(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Logging": { | |
"LogLevel": { | |
"Default": "Warning" | |
} | |
}, | |
"AllowedHosts": "*", | |
"HealthChecks-UI": { | |
"HealthChecks": [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddApplicationInsightsTelemetry(); | |
services.AddLogging(config => | |
{ | |
config.AddApplicationInsights(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IGraphApiService | |
{ | |
Task<User> GetCurrentProfileAsync(); | |
Task<IEnumerable<User>> SearchUsersAsync(string search, int limit); | |
Task<IEnumerable<User>> GetUsersAsync(IEnumerable<string> userIds); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var authSettings = configuration.GetSection("AzureAd").Get<AzureAdOptions>(); | |
services | |
.AddAuthentication(sharedOptions => | |
{ | |
sharedOptions.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; | |
}) | |
.AddJwtBearer(options => | |
{ | |
options.Audience = authSettings.ClientId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (env.IsDevelopment()) | |
{ | |
services.AddSignalR().AddNewtonsoftJsonProtocol(); | |
} | |
else | |
{ | |
string azureSignalrConnectionString = configuration["Azure:SignalR:ConnectionString"]; | |
services.AddSignalR().AddNewtonsoftJsonProtocol().AddAzureSignalR(options => | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const useTodos = () => useRecoilValue(todoListState); | |
export const useLoadTodos = () => | |
useRecoilCallback( | |
async ({ set }) => { | |
const response = await fetch(`${apiUrl}/todos`); | |
const results = await response.json(); | |
return set(todoListState, results); | |
}, | |
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const todoListState = atom<Todo[]>({ | |
key: 'todolist', | |
default: [], | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const StoreContext = createContext<TodoList>({} as TodoList); | |
type StoreContextProviderProps = { | |
children?: ReactNode; | |
}; | |
export const StoreProvider = ({ children }: StoreContextProviderProps) => { | |
const todoList = new TodoList(); | |
return ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class TodoList { | |
@observable.shallow list: Todo[] = []; | |
constructor() { | |
autorun(() => { | |
this.load(); | |
}); | |
} | |
@action |
NewerOlder