-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vite Records options are now reassignable.
- Loading branch information
Showing
6 changed files
with
58 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) 2023 Quetzal Rivera. | ||
// Licensed under the MIT License, See LICENCE in the project root for license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection.Metadata.Ecma335; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Vite.AspNetCore.Extensions; | ||
|
||
/// <summary> | ||
/// Define extension methods for <see cref="ViteOptions"/> | ||
/// </summary> | ||
internal static class ViteOptionsExtensions | ||
{ | ||
/// <summary> | ||
/// Returns the Vite Dev Server Url. | ||
/// </summary> | ||
/// <param name="options"></param> | ||
/// <returns></returns> | ||
internal static string GetViteDevServerUrl(this ViteOptions options) | ||
{ | ||
// Get the port and host from the configuration. | ||
var host = options.Server.Host; | ||
var port = options.Server.Port; | ||
// Check if https is enabled. | ||
var https = options.Server.Https; | ||
|
||
// Return the url. | ||
return $"{(https ? "https" : "http")}://{host}:{port}"; | ||
} | ||
} |
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
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
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
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
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