integrativesoft / lara

Lara Web Engine is a lightweight C# framework for web user interface development.
Apache License 2.0
153 stars 9 forks source link

Publishing File Issue #97

Closed Seji64 closed 4 years ago

Seji64 commented 4 years ago

Hi again,

i tried to publish a JS File. But i am getting the error, that the file cannot be found.

grafik

 class Program
    {
        static async Task Main()
        {
            using var app = new Application();
            await app.Start(new StartServerOptions
            {
                Mode = ApplicationMode.Default,
                PublishAssembliesOnStart = true,
                Port = 1337
            });

            var bytes = File.ReadAllBytes("JS\\Helper.js");
            var content = new StaticContent(bytes, ContentTypes.ApplicationJavascript);
            LaraUI.Publish("/helper.js", content);

            await app.WaitForShutdown();
        }
    }

I am doing something wrong?

pablocar80 commented 4 years ago

I’ll take a look at it tonight when I get to the computer. In the meantime, is there an app.Publish method you can use, instead of calling LaraUI.Publish?

Seji64 commented 4 years ago

Ahh, this works perfectly. You should update your Documentation cause the example there is using LaraUI.Publish

Thanks for your help anyway!

pablocar80 commented 4 years ago

Will do, let’s leave this issue open until I update it

pablocar80 commented 4 years ago

Updated documentation. Also considering deprecating static methods to avoid confusion.