Shopercase Node.js API
The Shopercase Node.js API that handles all of the functionality of the Shopercase application.
Documentation.
For more information about our app see the Shopercase Documentation
Requirements
Node.js 16 or higher
Installation
Install all dependencies:
yarn add
Run the application
Now run the application
yarn serve
# This will run the server on port 5000
Usage
The following command is used to test the application to see if it works or not
import express, { json, urlencoded } from "express";
const PORT = process.env.PORT || 5000; // if you have an environment variable saved on your local machine then the application would look for the env file and run the first port instead
const app = express();
app.use(json());
app.route("/").get(function (req, res) {
res.send("✅Server is running live");
});
app.listen(PORT, () => {
console.log(`Server started on PORT: ${PORT}`);
});
Note: If you are not familiar with the route method you can use the following:
app.get('/', (req,res) => {
// code goes here
})
Configure the Env file
Here is a simple step to configure the env file to work for the application
import * as dotenv from "dotenv";
dotenv.config();
For this to work properly you must first install the dotenv dependency.
Install the dependency
Here’s a simple guide on how to install the dotenv dependency
yarn add dotenv
# or
npm install dotenv
Support
We will release new bug fixes and features to keep the app up-to-date. If you have any issues with the app please kindly see the issue tracker