Skip to content

Instantly share code, notes, and snippets.

View way2datta's full-sized avatar
🐌
Not only working software but also well crafted software.

Dattatray Kale way2datta

🐌
Not only working software but also well crafted software.
View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
namespace Assignment
{
internal class Program
{
private static Dictionary<string, int> CGR = new Dictionary<string, int>();
private static Dictionary<string, string> iCat = new Dictionary<string, string>();
using System;
using System.Collections.Generic;
namespace NMart.Billing
{
internal class NMartStore
{
private static Dictionary<string, int> CategoryGstRatesInPercentage = new Dictionary<string, int>();
private static Dictionary<string, string> ItemsInCategory = new Dictionary<string, string>();
using System;
using System.Collections.Generic;
namespace NMart.Billing
{
internal class NMartStore
{
private static Dictionary<string, int> CategoryGstRatesInPercentage = new Dictionary<string, int>();
private static Dictionary<string, string> ItemsInCategory = new Dictionary<string, string>();
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (request, response) => response.send('Hello World!'));
app.get('/users', (request, response) => response.send("Get users"));
app.get('/users/:id', (request, response) => response.send("Get user by id"));
@way2datta
way2datta / well-formatted-and-readable
Last active November 21, 2018 14:58
Well formatted readable urls
HTTP POST http://localhost:3000/login
HTTP POST http://localhost:3000/authorize
HTTP POST http://localhost:3000/register
HTTP GET http://localhost:3000/users
HTTP GET http://localhost:3000/users/:id
HTTP DELETE http://localhost:3000/users/:id
HTTP PUT http://localhost:3000/users/:id
HTTP POST http://localhost:3000/users
HTTP GET http://localhost:3000/users/:id/expenses/categories
HTTP GET http://localhost:3000/users/:id/expenses/categories/:categoryId
@way2datta
way2datta / Route-expense-tracker-after.js
Last active November 21, 2018 15:00
Well formatted readable urls for rest api's
import { Router } from 'express';
import { LoginController } from '../controllers/loginController';
import { AuthController } from "../controllers/authController";
import { UserController } from "../controllers/userController";
import { ExpenseCategoryController } from "../controllers/expenseCategoryController";
import { ExpenseController } from "../controllers/expenseController";
const router = Router();
const loginController = new LoginController();
@way2datta
way2datta / Poorly formatted and poorly named urls and http methods
Last active November 21, 2018 15:33
Poorly formatted and poorly named urls and http methods
HTTP GET http://localhost:3000/userJWTValidation
HTTP GET http://localhost:3000/JwtValidation
HTTP GET http://localhost:3000/creationOfUserDetails
HTTP GET http://localhost:3000/getAllusersDetails
HTTP GET http://localhost:3000/fetchUserDetails
HTTP GET http://localhost:3000/deletionOfUserDetails
HTTP GET http://localhost:3000/updationOfUserDetails
HTTP GET http://localhost:3000/getExpenseCategoryOfUsers
HTTP GET http://localhost:3000/getExpenseCategoryOfUser
HTTP GET http://localhost:3000/deletionExpenseCategoryOfUser
@way2datta
way2datta / Route-expense-tracker-before.js
Last active November 21, 2018 15:34
Route-expense-tracker-before.js
import { Router } from 'express';
import { LoginController } from '../controllers/loginController';
import { AuthController } from "../controllers/authController";
import { UserController } from "../controllers/userController";
import { ExpenseCategoryController } from "../controllers/expenseCategoryController";
import { ExpenseController } from "../controllers/expenseController";
const router = Router();
const loginController = new LoginController();
@way2datta
way2datta / list-urls-and-verbs-in-restful-service.js
Created November 22, 2018 04:27
List down endpoints urls and http verbs that was built by using Node + Express
const express = require('express');
import routes from './routes/rest-api';
const app = express();
const port = 3000;
const hostUrl = "http://localhost:3000"
app.use('/', routes);
routes.stack.forEach(function (element) {
@way2datta
way2datta / ExpenseTracker.txt
Created November 25, 2018 15:14
Simple Expense tracker application for study purpose
**Use Cases**
- User can register his/her account.
- An account owner can log into the system.
- An account owner can view, add, update, and delete category for expenses.
- An account owner can view, add, update, and delete expense.