When running Ionic 2 with the following command,
ionic serve
I get this:
WARN: ionic.config.js has been deprecated, you can remove it.
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server: http://localhost:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit
Here is the ionic config file:
{
"name": "firebaseStart",
"app_id": "",
"v2": true,
"typescript": true
}
How can i run it ?
This is fine. See √ Running dev server: http://localhost:8100
open browser and navigate to
http://localhost:8100
Related
I have a flutter app using Firebase's cloud firestore. I've done the web build and running it on Chrome through Android Studio works well. I would like to share my web app progress to my client but don't want to host it (because it's not finished yet). Hence I'd like to find a way to run it locally the same way you can do it with Android Studio but without needing to install Android Studio (and hopefully not requiring to install flutter either), so that I can send the build file to my client and they can run it in their machine (with a script to start the web server locally and run the web app).
I have tried the following script included inside the web build folder (where the index.html is)
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from httplib import HTTPResponse
from os import curdir,sep
#Create a index.html aside the code
#Run: python server.py
#After run, try http://localhost:8080/
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == '/':
self.path = '/index.html'
try:
sendReply = False
if self.path.endswith(".html"):
mimeType = 'text/html'
sendReply = True
if sendReply == True:
f = open(curdir + sep + self.path)
self.send_response(200)
self.send_header('Content-type', mimeType)
self.end_headers()
self.wfile.write(f.read())
f.close()
return
except IOError:
self.send_error(404,'File not found!')
def run():
print('http server is starting...')
#by default http server port is 80
server_address = ('127.0.0.1', 8080)
httpd = HTTPServer(server_address, RequestHandler)
try:
print 'http server is running...'
httpd.serve_forever()
except KeyboardInterrupt:
httpd.socket.close()
if __name__ == '__main__':
run()
But when opening http://localhost:8000 on Chrome I get a blanc page and the console shows the errors:
Failed to load resource: net::ERR_EMPTY_RESPONSE main.dart.js:1
Failed to load resource: net::ERR_EMPTY_RESPONSE manifest.json:1
Failed to load resource: net::ERR_EMPTY_RESPONSE :8080/favicon.png:1
I also tried NPM local-web-server by running ws --spa index.html but just getting a ERR_EMPTY_RESPONSE response.
This is what I have in my build/web after running flutter build web:
How can I create a local server where I can host my web app locally and run it locally without hosting it on the internet?
as you mentioned in the comment here you go.
Create a file app.js with the following:
const express = require('express')
const app = express()
const port = 8000
app.get('/', (req, res) => {
console.log('getting request')
res.sendFile('website/y.html',{root:__dirname})
})
app.use(express.static(__dirname + '/website'))
app.use((req, res)=>{
res.redirect('/')
})
app.listen(port, () => {
console.log(`app listening at http://localhost:${port}`)
})
Here my website files exist at website folder and my entry point is y.html.
Set the static file directory (your website page) and then serve the .html for the root request
example project: https://github.com/ondbyte/website
Finally, to run it open terminal and move to the root folder. Then do
npm init
npm install express --no-save
node app.js
Here is the more simpler way. NO NEED to setup server
open your Build/web folder in vscode.
install Live server Plugin in vscode.
hit Golive Button
Here you go your flutter web app would be running locally without android studio.
So far REST API get method working in my local ng serve , but in my device not working.
Android device remote debug showing :URL:'localhost/get/list'
proxy.config.json
"/code":{
"target": "http://192.x.x.x:8010",
"secure":false,
"changeOrigin": true,
"logLevel": "debug"
},
Serive Get Method:
this.service.getUrl('/get/list','level=2').subscribe(
data=>{ //Android Device URL :localhost/get/list not showing proxy.config.url
});
package.json
"start": "ng serve --proxy-config proxy.conf.json",
Remote Debug Result:**I can't get **_body result like local result , it's seems getting index.html page.
Local ng Serve Result:
If you are using the emulator and the API is on your local machine, change the IP address in proxy.config.json to 10.0.2.2. Check out How do you connect localhost in the Android emulator?
Guys, just want to know whether Universal link can work with HTTP website instead of HTTPS.
If i use universal links in www.mydomain.co.id/match/play_2.html
Entitlement setting is applinks:kumpul.co.id right? But for the apple-app-site-association, i upload it to http://www.mydomain.co.id ,
{
"applinks": {
"apps": [],
"details": [
{
"appID": "[TeamID].id.co.mydomain",
"paths": [ “match/*”]
}
]
}
}
so the location will be http://www.mydomain.co.id/apple-app-site-association. Is it the right configuration ?
3.For debugging information, how could i see my log in iphone when debugging via Xcode to check my code is correct? because when i click links from Whatsapp for example, i can't see the the log in my console
Universal Links URLs can be either http:// or https://. However, the apple-app-site-association file MUST be served over HTTPS otherwise iOS will refuse to scrape it.
This scraping happens only when the app is first installed, and during updates installed from the App Store. Not for every link open. If the scraping attempt fails, you will see an error like this in the OS-level (not App-level in Xcode) logs:
Sep 21 14:27:01 iPhone swcd[2044] <Notice>: 2015-09-21 02:27:01.878907 PM [SWC] ### Rejecting URL 'https://examplecustomdomain.com/apple-app-site-association' for auth method 'NSURLAuthenticationMethodServerTrust': -6754/0xFFFFE59E kAuthenticationErr
Followed the instructions for creating an SSL set of files with a self signed certificate according to rabbit docs.
I am using it for the management plugin instead only for now, by configuring rabbitmq.config like:
{rabbitmq_management, [ {http_log_dir, "/tmp/rabbit-mgmt"},
{rates_mode, basic},
{listener, [{port, 7357},
{ssl, true},
{ssl_opts, [{cacertfile, "/path/to/ca_certificate.pem"},
{certfile, "/path/to/server_certificate.pem"},
{keyfile, "/path/to/server_key.pem"},
{verify,verify_peer},
{fail_if_no_peer_cert,false}
]}
]}
]}
The server starts, and the https port seems open, however, the connection fails as soon as a request is received with:
=ERROR REPORT==== 25-Sep-2015::14:25:33 ===
application: mochiweb
"Accept failed error"
"{error,{options,{cacertfile,\"/path/to/ca_certificate.pem\",\n {error,eacces}}}}"
=ERROR REPORT==== 25-Sep-2015::14:25:33 === {mochiweb_socket_server,295,{acceptor_error,{error,accept_failed}}}
I tried chown and chgrp of the folders that have all the certificate files created by following the documentation, but still have the same access error.
The problem was related to file permissions, the folders were all granting rabbitmq read access, but they were inside another folder without access.
httpd.conf set listen:9080 (listen 80 would not work with windows 10 visual studio is somehow stopping it working.)
so url that works is http://localhost:9080/project2
php.ini settings appeared correctly in phpinfo()
[xdebug]
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost:9080
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
and set in eclipse
preferences -> php -> Servers -> edit
Base URL: http://localhost:9080
Local Web Root : C:\wamp\bin\php\php5.5.12
Servers -> What is path mapping?
Path on Server ? http://localhost:9080/project2
Local Path ? C:\Apache24\htdocs\project2
Set PHP Executables as follows:
Executable Path: C:\wamp\bin\php\php5.5.12
php.ini: C:\wamp\bin\php\php5.5.12\php.ini
Debug -> Run Configurations -> Debugger -> Configure
Accept Remote Session: tried localhost and prompt
Tried in Chrome and Opera they both run without stopping.
Can debug by printing to page though would like to use debugger.
Cannot think of any other reason debug set and green in chrome. Tried disabling it and selecting debug again.
Please reply soon.