Question about server vs client

I’m working on an application that uses ajax to get data from an API. When I put my API call with $.ajax into the main.js - client it works perfectly, but when I put it into the main.js - server, I get an error that $ is not defined. What am I missing here?

Use this on the server:

jQuery does not get bundled on the server.

2 Likes

Thank you very much for the help

@XingWei the reason this happens is because $ (the jquery package) is a front end only package that won’t be included on the server.

Meteor obscures the face that you are actually building two apps simultaneously, so you should always be asking yourself “is this running on the server, the client, or on both?”