Simple when run npm run dev, adonisjs will run with domain:
But i wanna config with domain:
Please help me!!!
Simple when run npm run dev, adonisjs will run with domain:
But i wanna config with domain:
Please help me!!!
Your question is not clear but I'll try to answer.
If you are trying to get those domain names on your development machine, take a look at this: http://adonisjs.com/recipes/4.0/dev-domains
If you are trying to host your Adonis app on a server, take a look at this: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04
If you are in development environment or local machine there is an answer here
But if your are in production environment you should install and config BIND9 or something like that to work as DNS Server but there is an alternative and simple solution:
Firstly register on http://cloudflare.com and add your domain on your dashboard. then it gives your two DNS you should set to your domain. then in the cloudflare dashboard create a A Record to point your domain to your server IP
Then install Nginx on your server to work as a Reverse Proxy and use this config to point your domain to your awesome adonisjs project:
server {
listen 80;
server_name blog.com;
location / {
proxy_pass http://localhost:3333;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Enjoy!