i new in software field, please have patience question , mistakes of technical terms:
premises:- have developed front-end application using angular4. baseurl define in angular application 'http://localhost:3000/'. application uses restangular api interact json-server (i created folder named json-server , has db.json , public folder ). working fine when start json-server using command: json-server json-server --watch db.json
my application finalized , created production build. thereafter moved files dist folder public folder of json-server. when start json-server, application works fine.
actual problem:- wanted host in azure. copied file/folder (db.json , public folder) json-server folder , put them in azure cloud. when azure hosting done , open url in browser got error- "you don't have permission view".
to rectify above error deleted files azure , copied files of dist folder , put them in azure cloud. using able see application in browser no images. @ image there error- response status: 0 url: null
when start json-server locally, works fine of course when same web page open other machines got same error- response status: 0 url: null
is there way run json-server in azure machines/mobile when accessing url, can see proper web page without error.
step step run json-server on azure web app:
open browser , go app service editor (
https://<your-app-name>.scm.azurewebsites.net/dev/wwwroot/)run command in console (ctrl+shift+c)
npm install json-server --save-devput file/folder (
db.json, public folder) wwwroot foldercreate
server.jsfollowing contentconst jsonserver = require('json-server') const server = jsonserver.create() const router = jsonserver.router('db.json') const middlewares = jsonserver.defaults() server.use(middlewares) server.use(router) server.listen(process.env.port, () => { console.log('json server running') })click run (ctrl+f5), generate
web.configfile automatically , open website in browser.

Comments
Post a Comment