---
title: "Greeter Example"
url: https://docs.zeroc.com/ice/3.8/greeter-example
language: js
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Greeter Example

Programming language: JavaScript. Other languages: [C++](https://docs.zeroc.com/ice/3.8/greeter-example/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/greeter-example/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/greeter-example/java.md), [MATLAB](https://docs.zeroc.com/ice/3.8/greeter-example/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/greeter-example/php.md), [Python](https://docs.zeroc.com/ice/3.8/greeter-example/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/greeter-example/ruby.md), [Swift](https://docs.zeroc.com/ice/3.8/greeter-example/swift.md).

Writing a client-server application with Ice does not take much code. See for yourself!

In this example, we describe how to write a simple client-server application, step by step.

This application is a typical Greeter: a server hosts a Greeter object that produces custom greetings, and the client calls the server to get these greetings. Even though it’s simple, this application demonstrates best practices and provides a good foundation for starting any Ice project.

We present this example in the following sections:

1. **Using Slice** - How to use the [Slice IDL](https://docs.zeroc.com/ice/3.8/slice.md) to define a contract between clients and servers.
2. **Writing a client** - How to write a Node.js client that communicates with an Ice server.
3. **Writing a browser client** - How to write a client that runs in a web browser.

This example has no server section for this language mapping. You can run the Greeter server from C++, C#, Java, Python or Swift, and call it from the client you write here.

The complete source code for this example is on [GitHub](https://github.com/zeroc-ice/ice-demos/tree/3.8/js/Ice/greeter), alongside several other demo programs.
