I believe it would be very useful to have a very simple example of a working feathers server. This extraordinary simple example assumes you are starting out with absolutely nothing except for a server connected to the internet, and a chrome browser.
It also assumes you are eager to see the greatest framework ever created working in a matter of seconds.
This example will simply return the server date.
WARNING - once you see this working, you will wonder why you wasted so much of your life looking at rails, trails, snails, meteor, deepstream, etc.
/* initialize constants, PAUSE here for a moment for previous scripts to load !! */
const app = feathers();
app.configure(feathers.socketio(io('ws://###.###.###.###:3030'))); /* put in your server IP ## */
/* one line of code (shown three for readability) to immediately execute promise */
(async () => {
try { let result = await app.service('tester').find() ;
console.log('the result is: ' + JSON.stringify(result)) }
catch (e) { console.log(e); } }
)() ;
You should now see your server date/time in your browser console.
I believe it would be very useful to have a very simple example of a working feathers server. This extraordinary simple example assumes you are starting out with absolutely nothing except for a server connected to the internet, and a chrome browser.
It also assumes you are eager to see the greatest framework ever created working in a matter of seconds.
This example will simply return the server date.
WARNING - once you see this working, you will wonder why you wasted so much of your life looking at rails, trails, snails, meteor, deepstream, etc.
1) install npm and feathers:
2) feathers generate app ;
3) feathers generate service ; -- select "A custom service" -- suggested name of your service is "tester"
4) edit this file:
./src/services/tester/tester.class.js
-- change:
-- to:
5) start your server!
6) open a browser tab, enter
about"blank
to make sure tab is really blank!7) enter the console and add the following lines
8) enter the following lines in the console
You should now see your server date/time in your browser console.