API
- CD to API folder
- Create [environment].json file in the server/config folder by copy development.json file (change [environment] by your environment)
- Create file .env in the root api folder. Then copy all content in to env.example file.
- Change all config by your config
# If live, it should production
NODE_ENV=development
APP_NAME=Genstore
ALLOW_CORS=true
# For live env, it should be 8080 or any port you want
PORT=9000
# This name will show in the Email content
SITE_NAME=Genstore
# Mongo DB url
MONGO_URI=mongodb://localhost/genstore-dev
## mailing
SENDGRID_API_KEY=xxxxx
SPARKPOST_API_KEY=xxx
# Just need spart post or sendgrid. Depend on your choosen service
MAIL_SERVICE=sparkpost
# Sender email
mailFrom=admin@mail.com
# Email for contact page
ADMIN_EMAIL=admin@genstore.com
# Information from Twilio config
SMS_FROM=+13232xxxxx
SMS_SID=ACaxxxxxxxxx
SMS_AUTH_TOKEN=950cd6xxxxxxxxx
EMAIL_NOTIFICATION_COMPLAIN=admin@genstore.com
EMAIL_NOTIFICATION_LOW_STOCK=admin@genstore.com
EMAIL_NOTIFICATION_REPORT=admin@genstore.com
EMAIL_NOTIFICATION_REFUND=admingenstore@yopmail.com
EMAIL_NOTIFICATION_NEW_SHOP=admingenstore@yopmail.com
# Quantity alert to admin and seller. If product quantity is lower than this number
# an email will be sent when user ordered this product
LOW_QUALITY_QUANTITY=1
# Stripe information for charge
STRIPE_API_SECRET=sk_test_3JufSICAFsZNPv4bnH6SpsPT
STRIPE_API_PUBLIC=pk_test_Z3rf3HSfsokHl4lLFTBxhZrZ
# Paypal API info for payment
# use sandbox or liv
PAYPAL_MODE=sandbox
PAYPAL_CLIENT_ID=AcBqoxAt02lIEP1MkHLV8HVnVOv0Rffx_R3TsQ49BXGBLX8NzEILBzLW5EVl
PAYPAL_CLIENT_SECRET=ENjHvhAKMWMYE-b5Uy3gAm31AZgF97-j03I11a8qL14rgEHOqfvTEnqYjU4V
# Website currency store wide. Use 3-character ISO-4217
# The currency MUST match with Paypal / Stripe currency which they support
# Check here https://developer.paypal.com/docs/classic/mass-pay/integration-guide/currency_codes/
SITE_CURRENCY=USD
# website will receive 20% in order total
# This value will be shown in the earning data
COMMISSION_RATE=0.2
# website will receive 20% in order total
# This value will be shown in the earning data
COMMISSION_RATE=0.2
# currency rate api https://www.currencyconverterapi.com/
# Use this api for currency exchange. If it is free version, set blank
CURRENCY_CONVERT_API_KEY=
## pusher https://dashboard.pusher.com
# Service for live chat message
PUSHER_APP_ID=591974
PUSHER_KEY=8cbf727dad3c8ce84888
PUSHER_SECRET=ee819750215e0a0fb335
PUSHER_CLUSTER=ap1
# Twitter login
TWITTER_CONSUMER_API_KEY=xxxxx
TWITTER_CONSUMER_SECRET=xxxx
# Google geocoding API
GOOGLE_GEOCODE_API_KEY=xxxxx
- Save all information
- Start app by command $ node server/www
- If you installed pm2, you can use pm2 to start the app and keep in the background. Use command $ pm2 start server/www –name=”api.yourapp.com”
- You can check IV for API folder if needed