mrellipse / toucan

Boilerplate template using Vue.js, TypeScript and .NET Core 2.1, based on SOLID design principles
MIT License
212 stars 36 forks source link

Deployment api/culture/* not found #9

Closed hmuhdkamran closed 6 years ago

hmuhdkamran commented 6 years ago

I have used the powrshell file for production, every time I host it on kestrel server it gives two errors,

  1. app..json not found, (when I hard cord it, the error disappears)
  2. the system stuck in fail to load resource: the /api/culture/SupportCultures
raen1978 commented 6 years ago

I have the same problem, /api/culture/SupportCultures not found, when publishing to production.

At dev all ok.

Thanks!

mrellipse commented 6 years ago

thanks for reporting that. I will try and reproduce.

i will put in a simple warning for app..json not found - it just means ASPNETCORE_ENVIRONMENT has not been explicitly set.

will try and reproduce the other /api/culture/SupportCultures issue after that

mrellipse commented 6 years ago

ok, that simple issue with environment variable is fixed up.

i could not repro the other issue though. could you provide a few more clues such as

TIA!

hmuhdkamran commented 6 years ago

Dear, The second issue with /api path is on every platform, I have tried IIS and nginx, but the same issue, I have use the clone of the project.

hmuhdkamran commented 6 years ago

I am sharing my link https://drive.google.com/open?id=0B-T1Z26dBcspOHRYWVVuVjhtX0cxRk9salZzby1OUmlIaV9v

mrellipse commented 6 years ago

thanks for that. will see if I can figure it out.

glad to see you are putting it behind a reverse proxy as recommended!

mrellipse commented 6 years ago

okay, 500 internal error, but the api filter is definitely working.

my first guess would be that it might be having problems enumerating the contents of the ./Resources folder?

if it can't find expected *.json language files, it would probably blow up.

hmuhdkamran commented 6 years ago

This is complete project, please do have a look

https://github.com/hmuhdkamran/Cms

mrellipse commented 6 years ago

Thanks for that. I will try to reproduce locally this weekend using IIS host, as I develop on windows.

mrellipse commented 6 years ago

hi @hmuhdkamran & hi @raen1978

okay, good news. so I was able to get the site running under IIS 10.0 using a build published directly to /dist.

the internal 500 run-time errors are definitely configuration related :)

your feedback did highlight some issues in the production logging output though- so I have done a new push to master branch - see update logging code

if you merge this commit into your project, you can then

you will then get a much better insight into the run-time errors being thrown. let me know how it goes

@hmuhdkamran i did manage to get your project running. I didn't get the exact same error on calls to /api, but I did notice an authentication error. as well as above, set the 'token issuer' value in app.production.json and try again 👍 1

hmuhdkamran commented 6 years ago

i have faced few issues while deploying on ubuntu,

  1. it gives UniversalTimeZone error, by replacing "defaultTimeZone": "Pakistan Standard Time" with "defaultTimeZone": "Asia/Karachi" the issue resolved.
  2. folder name Resource in is not recognizable, it should be in lower case.
  3. the private const string DefaultEnvironment = "Production"; is having Capital first letter, and the json files are in lower case, they must be same case.
  4. string fileName = fileName = $"{webRoot}\\index.html"; should be string fileName = fileName = $"{webRoot}/index.html"; and fileName = $"{webRoot}/{area.ToLower()}.html"; use forward slash.

Suggestions: to achieve lazy loading in vue.js if we use const GeneralLayout = resolve => (require as any)(['../layout/general/general'], function (module){ resolve(module.GeneralLayout) }); instead of import { GeneralLayout } from '../layout/general/general'; it improves.

if we use layout for separate login/register and for authenticated routs. i.e component: WindowsLayout, path: '/', meta: { roles: [UserRoles.User] }, children: []

any one who want to see please login http://sqanetcore.thetowertech.com/

if any one need login please email me. muhammad.kamran@pgc.edu regards

mrellipse commented 6 years ago

Thanks for the deployment feedback !

2,3 & 4 quite easy to patch. I remember running across those in an experimental branch (that builds up a docker image), but I must have forgot to apply the fixes in master branch.

Definitely interested in coming up with an async strategy, so will take your advice above.

All the best !

On Tue, Dec 12, 2017 at 11:49 PM, H.Muhammad Kamran < notifications@github.com> wrote:

i have faced few issues while deploying on ubuntu,

  1. it gives UniversalTimeZone error, by replacing "defaultTimeZone": "Pakistan Standard Time" with "defaultTimeZone": "Asia/Karachi" the issue resolved.
  2. folder name Resource in is not recognizable, it should be in lower case.
  3. the private const string DefaultEnvironment = "Production"; is having Capital first letter, and the json files are in lower case, they must be same case.
  4. string fileName = fileName = $"{webRoot}\index.html"; should be string fileName = fileName = $"{webRoot}/index.html"; and fileName = $"{webRoot}/{area.ToLower()}.html"; use forward slash.

Suggestions: to achieve lazy loading in vue.js if we use const GeneralLayout = resolve => (require as any)(['../layout/general/general'], function (module){ resolve(module.GeneralLayout) }); instead of import { GeneralLayout } from '../layout/general/general'; it improves.

if we use layout for separate login/register and for authenticated routs. i.e component: WindowsLayout, path: '/', meta: { roles: [UserRoles.User] }, children: []

any one who want to see please login http://sqanetcore.thetowertech.com/ http://url

if any one need login please email me. muhammad.kamran@pgc.edu regards

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/mrellipse/toucan/issues/9#issuecomment-351041937, or mute the thread https://github.com/notifications/unsubscribe-auth/AF30Xb4W40ywHuJOUhImQ4OwuyJTsBV7ks5s_nZagaJpZM4Q3adI .

mrellipse commented 6 years ago

okay, those issues with production builds for linux are patched now. +1 for

'server' "! شاپر سرور. I am captain Kirk!"

I couldn't access the squanetcore site though? There is an Content Security Policy issue affecting the bootstrapping process. I used my google fu and reckon you may might need to modify nginx or kestrel to append this header when serving the root files ...

Content-Security-Policy: script-src 'unsafe-inline';

Let me know when I can access the site - curious to have a look!

mrellipse commented 6 years ago

glad to see the site is up and running now. will close this issue down