Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ceee/ViteProxy
Proxy for vite projects within ASP.NET Core
https://github.com/ceee/ViteProxy
Last synced: about 2 months ago
JSON representation
Proxy for vite projects within ASP.NET Core
- Host: GitHub
- URL: https://github.com/ceee/ViteProxy
- Owner: ceee
- License: mit
- Created: 2022-11-10T16:03:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-24T11:35:31.000Z (4 months ago)
- Last Synced: 2024-06-28T18:25:54.237Z (3 months ago)
- Language: C#
- Size: 33.2 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
![ViteProxy](https://raw.githubusercontent.com/ceee/ViteProxy/main/viteproxy.png "ViteProxy")
## Introduction
**ViteProxy** is a proxy for vite projects within ASP.NET Core.
This project is meant to be used within server-side applications and not within SPAs (single-page applications).
Without ViteProxy you would have to start your server application (e.g. dotnet run) and additionally the vite dev server (e.g. npm run dev). The proxy is registered as a hosted service and started in tandem with the server application.## Usage
### 1. Register service
```csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddViteProxy();
```### 2. Deliver additional static files
```csharp
var app = builder.Build();app.UseStaticFiles();
app.UseViteStaticFiles();
```### 3. Configure vite.config
```js
export default {
...,
server: {
port: process.env.PORT || 2341,
cors: true
},
...
};
```## License
[MIT License](https://github.com/ceee/PocketSharp/blob/master/LICENSE-MIT)