Skip to content

Hello World

Sumeet Chhetri edited this page Sep 13, 2018 · 2 revisions

Hello World!

ffead-cpp provides a helper script to bootstrap a new application so that the entire application skeleton can be created with a few simple steps.

Assuming that you have ffead-cpp source located at "/home/user/ffead-cpp/" which we will refer henceforth as the ffead-cpp-src folder,

Steps

  1. Lets first remove the sample applications present in the ffead-cpp-src/web directory rm -rf ffead-cpp-src/web/*
  2. Execute the ffead-cpp-src/ffead_gen.sh script
  3. First it will ask for the name of the new application to be created, type hello_world and press Enter
  4. Then it asks for any external library names that your new application needs for compilation, our new Hello World program does not depend on any external libraries for now, so just press Enter
  5. Then it will ask the type of configuration mechanism you prefer xml or marker based, if you prefer xml type xml or just type marker and press Enter
  6. Next it will ask you which artifact type you need to create, you can create Controllers, Filters and RestController at this prompt, we just need a simple controller for our simple program, so just type c and press Enter
  7. Noe you can type the name of your first ffead-cpp controller that will render Hello World HTML page for you, So you can just type HelloWorldController and press Enter
  8. We don't want to create any more artifacts so just type e and press Enter
  9. Type y and press Enter to move ahead with the creation of the application skeleton for our new Hello World application
  10. ./autogen.sh
  11. ./configure
  12. make build-apps
  13. cd ffead-cpp-2.0-bin/
  14. ./server.sh

Point your browser at http://localhost:8080/hello_world/index.html and see if everything works!

Below is a sample snapshot of the bootstrap session,

LPT0000x+user@LPT0000x ~/home/user/ffead-cpp
$ ./ffead_gen.sh
echo "*****************************************************************************"
ffead-cpp Automated application generator utility
This Utility helps create sample application skeleton for ffead-cpp framework
Usage:
    ./ffead_gen.sh
    Enter Application Name: test
    Enter Library dependencies: -llib1 -llib2 -llib3
    (Or alternatively lib1 lib2 lib3)
    The generator will now create application directories and makefile,
    configure.ac will also be modified, Do you want to proceed (y/n): y
echo "*****************************************************************************"

Enter Application Name:
hello_world

Enter Library Dependencies:	

Enter Configuration type (xml/markers):
markers

Enter Artifact Type to create (c:Controller f:Filter r:RestAPI e:Continue):
c
Enter Class names:
HelloWorld

Enter Artifact Type to create (c:Controller f:Filter r:RestAPI e:Continue):
e

The generator will now create application directories and makefile,
configure.ac will also be modified, Do you want to proceed (y/n):
y

Application Name: hello_world
Library Dependencies:
Generator will now generate a new application directory /home/user/ffead-cpp/web/hello_world
Application directory created Successfully
Application config directory created Successfully
Application include directory created Successfully
Application src directory created Successfully
Application src/autotools directory created Successfully
Application Makefile created Successfully