Open dev server

Active3 hr before
Viewed126 times

7 Answers



Example_snippet/controller/utility/_server.js/ server.listen(8081,"",f. . .
server.listen(8081, "", function(err) {
   if (err) {
load more v

A web server for development without bundling,,You can use different components from es-dev-server as a library and integrate it with other tools:,We will continue to support fixing bugs for es-dev-server

Example_snippet/controller/utility/_server.js/ npx es-dev-server --node-resol. . .
npx es - dev - server--node - resolve--watch
load more v

npm i webpack-dev-server,Gitgithub,com/webpack/webpack-dev-server,github

Example_snippet/controller/utility/_server.js/ npm install webpack-dev-server. . .
npm install webpack - dev - server--save - dev
load more v

List of hosts that are allowed to access the dev server,,Opens the url in default browser

Example_snippet/controller/utility/_server.js/ ng serve <project. . .
      ng serve <project> [options]
load more v

In your case the value would be /app,,You can also rewrite a bit of your config so you don't have to pass cli commands

Example_snippet/controller/utility/_server.js/ output: { publicPath: '/ap. . .
output: {
      publicPath: '/app', // deploy on server with /app/ folder name
      filename: '[name].bundle.js',
      path: path.resolve(__dirname, 'public')

   devServer: {
      contentBase: './dist',
      host: 'localhost',
      port: '3000',
      inline: true,
      compress: true,
      proxy: {
         '/api/**': {
            target: '',
            secure: false,
            changeOrigin: true,
            cookieDomainRewrite: true
      open: true, // Here
      openPage: '/app' // And here
load more v

At some point you may want to show someone else the project you’ve been working on, Fortunately, there are a couple of good tools to accomplish this, localhost

Example_snippet/controller/utility/_model.js/ $ ssh -R 80:localhost:8080 ssh. . .
$ ssh - R 80: localhost: 8080
# In
case your development server doesn 't run on port 8080 you need to change the number to the correct port
load more v

This option allows you to whitelist services that are allowed to access the dev server,,Enable webpack's Hot Module Replacement feature:,that will give some background on where the server is located and what it's serving

Example_snippet/controller/utility/_model.js/ var path = require('path'); m. . .
var path = require('path');

module.exports = {
   devServer: {
      static: {
         directory: path.join(__dirname, 'public'),
      compress: true,
      port: 9000,
load more v