Code Monkey home page Code Monkey logo

topcoder-starterpack_bluemixnode's Introduction

Blue mix starter

Description

A starter pack for nodejs with bluemix deployment.

Requirements

Configuration

Name Description
PORT The port to listen
VERBOSE_LOGGING The flag if debug logging in enabled

Local deployment

npm run <script> Description
start Serves the app in prod mode. It will override config with config/production.js
dev Same as npm start, but enables nodemon for the server as well.
lint Lint all .js files.
lint:fix Lint and fix all .js files. Read more on this.
spec Run unit tests
spec:watch Run unit tests in watch mode
e2e Run e2e tests
e2e:watch Run e2e tests in watch mode
coverage Run unit tests and verify coverage
check-coverage Verify coverage only
test Run lint, tests and checks coverage

Bluemix deployment

  1. go to https://console.eu-gb.bluemix.net
  2. click Create app
  3. pick SDK for Node.js
  4. pick any free App name and click Create
  5. Click on the app and go to tab Getting started
  6. Download the Starter Code from Bluemix by clicking DOWNLOAD STARTER CODE
  7. Unpack this starter code to a different location, and only copy the manifest.yml to your project directory
  8. If you copied manifest.yml to your project directory, you can just run cf push for deployment. If you didn't copy over the manifest.yml, you'll have to tell cf push <appnamehere>

Testing

Import postman/Bluemix starter.postman_collection.json collection and postman/bluemix starter.postman_environment.json environment.

Live demo http://sky-bluemix-starter.eu-gb.mybluemix.net/api/test

topcoder-starterpack_bluemixnode's People

Contributors

lstkz avatar rootelement avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

topcoder-starterpack_bluemixnode's Issues

[$250, $100, $50] Starter Pack - Simple Services Definition

Description:

In this challenge, we'll be adding to the base services provided by this REST API. Implementing these services will serve two causes:

  1. Implement and document the setup, connection, and best practice use of Bluemix Services
  2. Provide a starting point for Services that are used in a lot of projects. If a project is started with this starter pack, but not used, it should be easily pulled out.

Requirements:

  1. Implement Bluemix SSO
    1. A user can register with a Google or Facebook Account
    2. A user can log in with a Google or Facebook Account
  2. Implement Cloudant DB
    1. Save a registered user to the db
    2. Save login count and last login by that user.
  3. /me secure endpoint
    1. Returns the logged in user's user object with count of successful logins of that user and last login date
  4. Update the postman files with your new endpoints
  5. Update README.md to clearly show:
    1. How to set up the services
    2. How to test your configuration
    3. How to remove a service - ie: if a project uses MongoDB, not Cloudant, it should be relatively easy to pull Cloudant out of the project and not leave shell code laying around.

Setup & Reference:

  1. Fork this project: https://github.com/topcoderinc/Topcoder-StarterPack_BluemixNode

Submissions:

  • Ensure good test coverage
  • Upload documentation for how to run your submission
  • Upload all your source code as a zip for review
  • Winner will be required to submit a pull request against develop with their winning code.

Problem with code "incompatible import/export statement used in *.js" ?

command line:-
Uploading droplet, build artifacts cache...
Uploading build artifacts cache...
Uploading droplet...
Uploaded build artifacts cache (3.6M)
Uploaded droplet (18.7M)
Uploading complete
Destroying container
Successfully destroyed container

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
FAILED
Error restarting application: Start unsuccessful

Log ( cf logs --recent)

2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR /home/vcap/app/src/app.js:5
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR import express from 'express';
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR ^^^^^^
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR SyntaxError: Unexpected token import
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at createScript (vm.js:56:10)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at Object.runInThisContext (vm.js:97:10)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at Module._compile (module.js:542:28)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at loader (/home/vcap/app/node_modules/babel-register/lib/node.js:144:5)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at Object.require.extensions.(anonymous function) [as .js] (/home/vcap/app/node_modules/babel-register/lib/node.js:154:7)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at Module.load (module.js:487:32)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at tryModuleLoad (module.js:446:12)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at Function.Module._load (module.js:438:3)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at Function.Module.runMain (module.js:604:10)
2017-07-08T10:21:28.03+0530 [APP/PROC/WEB/0] ERR at Object. (/home/vcap/app/node_modules/babel-cli/lib/_babel-node.js:154:22)
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! Linux 4.4.0-75-generic
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! argv "/home/vcap/app/vendor/node/bin/node" "/home/vcap/app/vendor/node/bin/npm" "start"
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! node v6.10.2
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! npm v3.10.10
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! code ELIFECYCLE
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! [email protected] start: better-npm-run start
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! Exit status 1
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR!
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! Failed at the [email protected] start script 'better-npm-run start'.
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! Make sure you have the latest version of node.js and npm installed.
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! If you do, this is most likely a problem with the bluemix-starter package,
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! not with npm itself.
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! Tell the author that this fails on your system:
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! better-npm-run start
2017-07-08T10:21:28.07+0530 [APP/PROC/WEB/0] ERR npm ERR! You can get information on how to open an issue for this project with:
2017-07-08T10:21:28.08+0530 [APP/PROC/WEB/0] ERR npm ERR! npm bugs bluemix-starter
2017-07-08T10:21:28.08+0530 [APP/PROC/WEB/0] ERR npm ERR! Or if that isn't available, you can get their info via:
2017-07-08T10:21:28.08+0530 [APP/PROC/WEB/0] ERR npm ERR! npm owner ls bluemix-starter
2017-07-08T10:21:28.08+0530 [APP/PROC/WEB/0] ERR npm ERR! There is likely additional logging output above.
2017-07-08T10:21:28.08+0530 [APP/PROC/WEB/0] ERR npm ERR! Please include the following file with any support request:
2017-07-08T10:21:28.08+0530 [APP/PROC/WEB/0] ERR npm ERR! /home/vcap/app/npm-debug.log


ref link:-
https://stackoverflow.com/questions/39436322/node-js-syntaxerror-unexpected-token-import/39436379.

[$200, $100] IBM Bluemix Node Starter Pack Base Package

Description:

The goal of this challenge is to create an easily usable, well documented shell project to build and deploy Node projects on IBM Bluemix.

You are welcome to start by cloning this repository:
https://github.com/topcoderinc/Topcoder-StarterPack_Node-Backend

If you start from that starter pack, please clear out any modules as we’ll be using Bluemix modules in subsequent challenges. If you prefer to start fresh, you can, but be sure to include all applicable items listed below.

Note: you will need to set up a Bluemix account to complete this challenge. You can do the 30 day trial for now. For subsequent Bluemix challenges, we will have trial codes.

Requirements:

  1. Provide a fully documented nodejs application that, when deployed, provides an api
  2. Make sure to implement the topcoder eslint - https://www.npmjs.com/package/eslint-config-topcoder
  3. One API endpoint:
    1. GET /test
    2. Return json object {“success”:true}
  4. Base yaml for the API
  5. Postman Collection
  6. Postman Environment Config
  7. README.md with headers:
    1. Project Title
    2. Description
    3. Requirements
    4. Local Deploy
    5. Bluemix Deploy
    6. Testing
  8. Running tests
  9. Bluemix manifest.yml for default deployment

Any other piece you think would be helpful, please ask in the forum.

Setup & Reference:

See the forums for documentation on why we're doing this, what the philosophy is, and how to approach a solution.

Submissions:

  • Deploy your shell to Bluemix, make sure your topcoder handle is in your Bluemix app name somewhere
  • Upload documentation for how to run your submission including your deployed Bluemix URL
  • Upload all your source code as a zip for review
  • Winner will be required to submit a pull request with their winning code.

Cann't access the Live demo

Description:

Why I cann't access the live demo?
404 Not Found: Requested route ('sky-bluemix-starter.eu-gb.mybluemix.net') does not exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.