# How to run a web server in WEB OS?

**URL:** <https://forum.webosose.org/t/how-to-run-a-web-server-in-web-os/589>\
**Category:** App Development\
**Created:** [October 17, 2018, 8:49am UTC](https://forum.webosose.org/t/how-to-run-a-web-server-in-web-os/589 "2018-10-17T08:49:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhkim](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dhkim](https://forum.webosose.org/u/dhkim)\
**Post date:** [October 17, 2018, 8:49am UTC](https://forum.webosose.org/t/how-to-run-a-web-server-in-web-os/589/1 "2018-10-17T08:49:46Z")

</div>

Hi all,

I am creating a webapp package with node.js express.

I tried to create new package for JS service and copied express package in node\_modules. But I am not sure how launch the service in WebOS package.

I have an experience to launch express web server via nodemon in Windows environment only. Can you please give an advice launch the service in WebOS ?

---

<div class="post-metadata">

**Author:** ![Changhyeok](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/changhyeok/32/247_2.png) [@Changhyeok](https://forum.webosose.org/u/Changhyeok)\
**Post date:** [October 17, 2018, 10:39am UTC](https://forum.webosose.org/t/how-to-run-a-web-server-in-web-os/589/2 "2018-10-17T10:39:44Z")

</div>

Please see [http://webosose.org/develop/sdk-tools/cli/command-usage/](http://webosose.org/develop/sdk-tools/cli/command-usage/)

---

<div class="post-metadata">

**Author:** ![ericblade](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/ericblade/32/39_2.png) [@ericblade](https://forum.webosose.org/u/ericblade)\
**Post date:** [October 23, 2018, 5:20pm UTC](https://forum.webosose.org/t/how-to-run-a-web-server-in-web-os/589/3 "2018-10-23T17:20:46Z")

</div>

so, normally, Javascript services are built to be run by activitymanager, when they are needed. For something like an always-on service, like that, though, you probably want to have a file in /etc/init that starts your service at system bootup... OR you can create an activity in activityManager that calls your node service at start, which would be a bit more of the "webOS way" of doing it, though either one should work equally well.

This is assuming that you are using webOS OSE, so you can build your system using bitbake.. if you install a file that looks a little something like this into /etc/init:

```auto
description "starts my web service"

start on (settingsservice-ready) or unified_service_server_restart
stop on started start_update

respawn

script
    exec run-js-service -u -g -k -w -n /usr/palm/srevices/(yourservicedirectory)
end script

```

then that should get you launched at startup.

I'd have to look up the specifics for doing it via activitymanager, which is the way i would do it if I didn't want to modify the startup files

---

<div class="post-metadata">

**Author:** ![ericblade](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/ericblade/32/39_2.png) [@ericblade](https://forum.webosose.org/u/ericblade)\
**Post date:** [October 23, 2018, 5:31pm UTC](https://forum.webosose.org/t/how-to-run-a-web-server-in-web-os/589/4 "2018-10-23T17:31:54Z")

</div>

note that that file may be entirely different for a system using systemd, which I believe OSE does. Please look at files in /etc/init for guide on that. My template may be completely wrong, I'm not working with OSE, but I do work with TVs, and older 🙂
