Deploy your application

Deploy your own package as a website and open it in the browser.

Chapter 3 of 4 · about 2 minutes

In this chapter we will deploy example-hello as a website, check it, and open our page in the browser. By the end, Nextweb will be serving the page we wrote.

We're in the shell we opened from the nextweb-tour folder.

Deploy it

These are the three steps we used for WordPress, with our own package in its place:

At the nextweb prompt
deploy hello to hello.example.com using example-hello
You should see
Site "hello" registered for hello.example.com (template: example-hello).

  Site root: /home/you/nextweb-tour/nextweb_server/sites/hello
  Runs: /home/you/nextweb-tour/nextweb_server/pkg/app/example-hello
  Status: pending, commit and apply to start it

Next steps:
  commit "Deploy hello"
  apply
  verify hello
At the nextweb prompt
commit "Deploy hello"
You should see
Committed: Deploy hello
Configuration validated.
Configuration written.
At the nextweb prompt
apply -y
You should see
Applying configuration...

Applying site configuration...

Site: hello (hello.example.com)
  Allocated site listen port 4004 for hello
  example-hello 0.1.0 runs from /home/you/nextweb-tour/nextweb_server/pkg/app/example-hello
Service hello: running example-hello 0.1.0 (manage with "service hello status" / "service hello restart")
Visit: http://127.0.1.10:4004/

Site apply complete.

Configuration changes complete!
Changes 1, Warnings 0, Errors 0

┌──────────────────────────────────────────────────────────┐
│  hello is live → http://127.0.1.10:4004/                 │
│  verify: passed · applied in 1.6 s                       │
└──────────────────────────────────────────────────────────┘
Next steps:
  verify hello
  service logs hello

Nextweb picked a port, started app.js with Node.js, checked that it answers, and handed us its address. The address and port on your screen may be different. How a deploy works explains what each step did.

Check it

At the nextweb prompt
verify hello
You should see
Verifying site: hello
state.json (domain: hello.example.com, status: applied)
package: example-hello 0.1.0
HTTP check passed (200)

Visit: http://127.0.1.10:4004/

All checks passed.

The HTTP check is the site.verify entry from our .nextwebrc. Your application on Nextweb says where the application's output goes and where it can keep files of its own.

Open it

Open the Visit address in a browser on this computer. The page says:

You should see
Hello from Example Company

What we have now

A website running our own package, built and published by us. Next, we'll share the package with a team and a second server.